Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^4: How to pass two lists to a sub?

by archen (Pilgrim)
on Nov 05, 2004 at 23:18 UTC ( #405664=note: print w/ replies, xml ) Need Help??


in reply to Re^3: How to pass two lists to a sub?
in thread How to pass two lists to a sub?

The main reason I use shift over @_ is to easily set up defaults and quickly get some error checking out of the way.
Consider:

my $var1 = shift || 'default'; my $var2 = shift || return 0;


Comment on Re^4: How to pass two lists to a sub?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (12)
As of 2014-11-26 17:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (172 votes), past polls