Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Processing ARGV

by kmullin (Acolyte)
on Dec 05, 2007 at 18:14 UTC ( #655156=note: print w/ replies, xml ) Need Help??


in reply to Re: Processing ARGV
in thread Processing ARGV

Interesting. When I run:

perl testARGV.pl 1 2 3 4 5

then I get

Start of testARGV.pl

and thats it! the error messages are gone, but where are the values I am trying to print? And I have the shebang in my code specifying

#!/opt/third/party/bin/perl -w

and I've verified that it does exists. (Its even in my PATH). When I do:

/opt/third-party/bin/perl -v

I see

This is perl, v5.6.0 built for Linux-2.4c2.3-i686 Copyright 1987-2000, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5.0 source +kit. Complete documentation for Perl, including FAQ lists, should be found +on this system using `man perl' or `perldoc perl'. If you have access to + the Internet, point your browser at http://www.perl.com/, the Perl Home Pa +ge.

Any more comments? Why don't I get my command line arguments.


Comment on Re^2: Processing ARGV
Select or Download Code
Re^3: Processing ARGV
by friedo (Prior) on Dec 05, 2007 at 18:20 UTC
    Odd. It works fine for me.
    $ perl testARGV.pl 1 2 3 Start of testARGV.pl 123
Re^3: Processing ARGV
by sh1tn (Priest) on Dec 05, 2007 at 18:29 UTC
    You may want to try
    perl -e 'print $_, $/ for @ARGV' 1 2 3 4 5 #which prints #1 #2 #3 #4 #5
    in order to assure yourself that perl has been installed correctly.
    And of course - see what `which perl` returns in case that the script works fine.


      I'm told that with a bad shebang, it uses /bin/sh, which is the ksh around here, so that explains that.

      I now have my code working. Thanks for your help.

Re^3: Processing ARGV
by chaos_cat (Scribe) on Dec 05, 2007 at 18:49 UTC
    At the risk of pointing out the obvious, or a typo on your part, the path you give for printing the perl version is not the same path you have in your shebang line. Specifically 'third/party' ne 'third-party'.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://655156]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (16)
As of 2014-10-20 19:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (89 votes), past polls