Beefy Boxes and Bandwidth Generously Provided by pair Networks httptech
Perl: the Markov chain saw
 
PerlMonks  

Re: Default subroutine parameters

by jeffenstein (Scribe)
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";


Comment on Re: Default subroutine parameters
Download Code

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 taking refuge in the Monastery: (8)
As of 2014-04-21 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (495 votes), past polls