Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: ARGV and online Perl commands

by toolic (Bishop)
on Jan 10, 2013 at 19:32 UTC ( #1012723=note: print w/replies, xml ) Need Help??


in reply to ARGV and online Perl commands

Here's what I get at my unix prompt:
perl -e "print $ARGV[1];" ONE- TWO- ARGV: Undefined variable.

But, if I change to single quotes to make my shell happy:

perl -e 'print $ARGV[1];' ONE- TWO- TWO-

UPDATE: when I switch my shell from tcsh to bash, I can duplicate your result.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1012723]
help
Chatterbox?
[choroba]: As discussed in Using the DATA file handle for ARGV, I usually start my "fun" scripts with *ARGV = *DATA{IO} unless @ARGV;
[choroba]: this was just a remainder

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2016-12-06 08:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (101 votes). Check out past polls.