Re: Win7 doesn't fill @ARGV
by GrandFather (Saint) on Nov 19, 2013 at 20:35 UTC
|
How are you running your Perl scripts? Command line? Desktop shortcut? Drag and drop onto a shortcut? Double click in Explorer?
I use drag and drop to shortcuts on the desktop frequently. The target line in the shortcut looks like:
C:\Perl\bin\wperl.exe C:\Tools\MyTool.pl
Using the command line works exactly as expected. Double clicking in the Explorer opens a script for editing.
True laziness is hard work
| [reply] [d/l] |
Re: Win7 doesn't fill @ARGV
by BrowserUk (Patriarch) on Nov 19, 2013 at 19:01 UTC
|
ftype perl
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] |
|
Thanks.
It says: perl="C:\Perl64\bin\perl.exe" "%1" %*, which is exactly what I found in the registry in the data field at HKEY_CLASSES_ROOT\pl_auto_file\shell\open\command.
However, .pl is associated with C:\Perl\bin\perl.exe, i.e. not perl64.
I tried to modify the command to remove the 64, but even though I thought I was running as administrator, the modify instruction wouldn't work.
The alternative would be to aim all my perl instructions to perl64 instead of perl.
Is there any advantage to using perl64 (v. 5.16.3)instead of perl (v. 5.12.4) on this 64 bit machine?
| [reply] |
|
It says: perl="C:\Perl64\bin\perl.exe" "%1" %*, which is exactly what I found in the registry in the data field at HKEY_CLASSES_ROOT\pl_auto_file\shell\open\command. However, .pl is associated with C:\Perl\bin\perl.exe, i.e. not perl64.
That's very confusing. So which version (32-bit or 64-bit) did you install? And if you've installed both, which did you install last?
I tried to modify the command to remove the 64, but even though I thought I was running as administrator, the modify instruction wouldn't work.
Hm. How did you try to change it?
What happened when you tried to change it? ie. did you get any error messages?
The alternative would be to aim all my perl instructions to perl64 instead of perl.
If you can't change it one way, why would you be able to change it the other?
Is there any advantage to using perl64 (v. 5.16.3)instead of perl (v. 5.12.4) on this 64 bit machine?
There are several advantages to using a 64-bit build of perl (regardless of the version).
- 32-bit perls are limited to 2GB of memory. With 64-bit you can use all the memory available on your machine.
- For many operations, the 64-bit version will run the identical code more quickly -- substantially so in some cases.
Of course, there are also downsides:
- The same program and data will occupy more memory -- up to double for some types of data.
- It can be harder or even impossible to get some XS-based modules to compile under 64-bit.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |
Re: Win7 doesn't fill @ARGV
by sundialsvc4 (Abbot) on Nov 20, 2013 at 04:45 UTC
|
| |
|
| [reply] |
Re: Win7 doesn't fill @ARGV
by VinsWorldcom (Prior) on Nov 19, 2013 at 19:10 UTC
|
[HKEY_CLASSES_ROOT\.pl]
"Perl_program_file"
[HKEY_CLASSES_ROOT\Perl_program_file\shell\Execute Perl Program\comman
+d]
"C:\strawberry\perl\bin\perl.exe" "%1" %*
| [reply] [d/l] |
Re: Win7 doesn't fill @ARGV
by ww (Archbishop) on Nov 19, 2013 at 20:54 UTC
|
Your surmise may be correct, but as the profession tells Med students, "don't go hunting for zebras in Kansas."
You have several other possibilities to explore, in the responses above... and several bits of info you haven't given us. They would probably help us to help you.
Whatever, Win7, AS 5.16, & CLI gives me this:
C:>perl -E "for (@ARGV) { say $_;}" abc def 123 "PM Question [id://106
+3372]"
abc
def
123
PM Question [id://1063372]
| [reply] [d/l] |
Re: Win7 doesn't fill @ARGV
by Anonymous Monk on Nov 19, 2013 at 22:18 UTC
|
| [reply] |
Re: Win7 doesn't fill @ARGV
by taint (Chaplain) on Nov 19, 2013 at 20:16 UTC
|
It's been a long time since I've been on a winboxen, so please pardon me.
But is Perl (perl.exe) within your $PATH, or %PATH, or whatever it is Win uses these days?
For example, does simply typing perl -V, produce anything || what you'd expect?
Sorry, just a bit of a guess.
--Chris
#!/usr/bin/perl -Tw
use Perl::Always or die;
my $perl_version = (5.12.5);
print $perl_version;
| [reply] |
|
Downvoted. Here's why:
- The OP says that his scripts aren't receiving arguments via @ARGV...
How would he know that if he was unable to run the script?
- It is not necessary to have perl.exe in your path in order to be able to run perl scripts on windows.
The assoc/ftype mechanism takes care of locating perl when the name of a perl script is typed at a command prompt; or .pl file is double clicked in the explorer.
- You say: "It's been a long time since I've been on a winboxen, so please pardon me." and then go on to give a (wrong) guess as an answer.
Do not feel obliged to give answers on subjects you have no relevant knowledge of. There are others who will know.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |