bnghtz

perl on win7 - execute .pl with args.txt

Dec 8th, 2014
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. Running perl with arguments fix
  2. Win7, Win8.1
  3.  
  4. 0: its recommended to install perl to "c:\perl\bin"
  5.  
  6. 1: win + pause (or right click my computer -> properties)
  7. advanced settings
  8. environment variables
  9. Path -> Edit: paste the followings in the front without the quotation marks
  10. "c:\perl\bin;"
  11. Or whatever you installed Perl.
  12. PATHEXT -> Edit: paste the followings in the front without the quotation marks
  13. ".PL;"
  14.  
  15. 2: apply the registry modification:
  16. Windows Registry Editor Version 5.00
  17.  
  18. [HKEY_CLASSES_ROOT\Applications\perl.exe\shell\open\command]
  19. @="\"C:\\Perl\\bin\\perl.exe\" \"%1\" %*"
  20.  
  21. == reboot not needed ==
  22. To test it write to "try.pl" the following lines until #END#
  23. if (@ARGV && scalar(@ARGV) > 0) {
  24. print "it's working!\n"
  25. . "parameters are: " . join(', ', @ARGV) . "\n";
  26. }
  27. else {
  28. print "it's not working, you screwed me over!\n";
  29. }
  30. <STDIN>;
  31. #END#
  32. Execute "try.pl nice try"
  33.  
  34. If it's working you can also use it from the command line of your Total Commander.
  35. Have a nice day!
  36.  
  37.  
  38. ps:
  39. if it's not working or do you use WinXP enter to a command line:
  40. but i'm doubt that anyone using XP nowdays...
  41. assoc .pl=Perl
  42. ftype Perl="C:\Perl\bin\perl.exe" "%1" %*
Advertisement
Add Comment
Please, Sign In to add comment