Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Default subroutine parameters

by jeffenstein (Monk)
on Apr 23, 2002 at 09:55 UTC ( #161249=note: print w/ replies, xml ) Need Help??


in reply to Default subroutine parameters

For subroutines with more than one argument:

sub mysub { return unless( (@_ % 2) == 0); my %args = ( host => 'localhost', port => 25, @_); # print "Args: host = $args{'host'}, port = $args{'port'}\n"; 1; } mysub( host => 'gatekeeper.dec.com', port => 80) or die "Mysub failed";

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (14)
As of 2016-06-29 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (370 votes). Check out past polls.