Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

sub argument passing? (TIMTOWTDI)

by temporal (Pilgrim)
on Sep 13, 2012 at 18:36 UTC ( #993555=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # single arg, used for simple and dirty
    sub foo {
    ...
        # will warn me if $href->{hello_sub} is not defined
        print 'hi!' if $href->{hello_sub};
    }
    
  2. or download this
    # processes arguments passed to subroutine in hashref
    # returns hash
    ...
        print 'hi!' if $opts{hello_sub};
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://993555]
Front-paged by lidden
help
Chatterbox?
and the web crawler heard nothing...

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

    How do you remember the number of days in each month?











    Results (191 votes), past polls