Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Ternary Operator for Multiple Arguments Passing

by reneeb (Chaplain)
on Dec 21, 2005 at 01:27 UTC ( [id://518220]=note: print w/replies, xml ) Need Help??


in reply to Ternary Operator for Multiple Arguments Passing

you are shifting when $ARGV[0] is true, then your second argument is in $ARGV[0], too.

It has to be
my $based_on = $ARGV[0] ? shift: 'tp'; my $top = $ARGV[0] ? shift: 1; print "$based_on $top\n";


But I would recommend to use Getopt::Long

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-23 21:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found