kmullin has asked for the wisdom of the Perl Monks concerning the following question:
I am a perl newbie, and am feeling very frustrated with this language. All I want to do is process command line arguments. In my PERL book, I see how to do this. So, I have a command:
#!/opt/third/party/bin/perl -w print "Start of testARGV.pl\n"; if ($#ARGV != 0) { foreach( @ARGV ) { print $_; } }
But when I try to run this, I get:
Start of testARGV.pl ./testARGV.pl:3: command not found: 0 ./testARGV.pl:5: unknown file attribute
What is going on here. The only '0' in my program is in the test to see if I even have command line arguments.
I'd appreciate any perls of wisdom you may have for me.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Processing ARGV
by moritz (Cardinal) on Dec 05, 2007 at 17:56 UTC | |
Re: Processing ARGV
by friedo (Prior) on Dec 05, 2007 at 17:57 UTC | |
by kmullin (Acolyte) on Dec 05, 2007 at 18:14 UTC | |
by chaos_cat (Scribe) on Dec 05, 2007 at 18:49 UTC | |
by sh1tn (Priest) on Dec 05, 2007 at 18:29 UTC | |
by kmullin (Acolyte) on Dec 05, 2007 at 19:08 UTC | |
by friedo (Prior) on Dec 05, 2007 at 18:20 UTC | |
Re: Processing ARGV
by almut (Canon) on Dec 05, 2007 at 18:10 UTC | |
by kmullin (Acolyte) on Dec 05, 2007 at 18:57 UTC | |
Re: Processing ARGV
by plobsing (Friar) on Dec 06, 2007 at 03:28 UTC | |
Re: Processing ARGV
by Erez (Priest) on Dec 06, 2007 at 08:50 UTC |