Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Ternary Operator for Multiple Arguments Passing

by neosamuri (Friar)
on Dec 21, 2005 at 01:29 UTC ( [id://518221]=note: print w/replies, xml ) Need Help??


in reply to Ternary Operator for Multiple Arguments Passing

my $based_on = $ARGV[0] ? shift: 'tp'; my $top = $ARGV[0] ? shift: 1;#change here print "$based_on $top\n"; # Then the rest of the code

The problem is that when use use shift you are removing the first element of the array therefore after the shift the second arg is the first in the @ARGV list.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2024-04-23 14:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found