Re: ARGV[] unable to pick up command line arguments
- From: "A. Sinan Unur" <1usa@xxxxxxxxxxxxxxxxxxx>
- Date: Mon, 19 May 2008 11:50:53 GMT
Niall Macpherson <niall.macpherson@xxxxxxxxxxxx> wrote in news:39f6e7b4-
c083-4203-bbcb-9f49369f06f6@xxxxxxxxxxxxxxxxxxxxxxxxxxx:
I've recently returned to using perl after a year or so away.
s/perl/Perl/
I therefore just tried running the following
use strict;
use warnings;
print "arg0=" , $ARGV[0], "\n", "arg1=", $ARGV[1], "\n";
No matter what I pass on the command line, single quoted , double
quoted or unquoted I never get anything in $ARGV[0] or $ARGV[1].
U:\PerlScripts>argv.pl "aaaaa" "ddddd"
Use of uninitialized value in print at U:\PerlScripts\argv.pl line 3.
arg0=
Use of uninitialized value in print at U:\PerlScripts\argv.pl line 3.
arg1=
The only command I can get to work is as follows
U:\PerlScripts>perl -le "print $ARGV[0]" "dddddddddd"
dddddddddd
U:\PerlScripts>
Having been away from perl for some time I guess I'm missing something
fundamental here. Perl is ActiveState 5.8.3
Most likely, this has nothing to do with Perl but with the fact that the
file association for .pl is not correctly set up (in the Windows
registry).
Make sure the following match the output of the same commands on your
system.
E:\> assoc .pl
..pl=Perl
E:\> ftype Perl
Perl="C:\opt\Perl\bin\perl.exe" "%1" %*
My guess is that on your system, the trailing %* will be missing. You
should be able to fix that. You can get help on the ftype command by
typing
E:\> ftype /?
Sinan
--
A. Sinan Unur <1usa@xxxxxxxxxxxxxxxxxxx>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
.
- References:
- ARGV[] unable to pick up command line arguments
- From: Niall Macpherson
- ARGV[] unable to pick up command line arguments
- Prev by Date: Re: ARGV[] unable to pick up command line arguments
- Next by Date: Re: ARGV[] unable to pick up command line arguments
- Previous by thread: Re: ARGV[] unable to pick up command line arguments
- Next by thread: Re: ARGV[] unable to pick up command line arguments
- Index(es):
Relevant Pages
|