Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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 1 2 3 4 5

then I get

Start of

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, the Perl Home Pa +ge.

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

Replies are listed 'Best First'.
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'.
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 friedo (Prior) on Dec 05, 2007 at 18:20 UTC
    Odd. It works fine for me.
    $ perl 1 2 3 Start of 123

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://655156]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2018-02-21 05:46 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (275 votes). Check out past polls.