Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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?
[holli]: I was company to my mother, bringing her to the therapy she has to take. There was another so called therapist outside smoking. We engaged in a talk with her and he turned out to be one of these lunatics telling people when they are sick it's their own
[holli]: fault for not thinking positively enough.
[LanX]: did he seriously hurt his fist at your nose in the end?
LanX .oO(positively thought)
[holli]: :) No. I might be small, but you don't want to be around me when I flip.
[LanX]: I can imagine ...
LanX hurts to be bitten between the legs ;-)
[holli]: You see, I have a friend whose daughter has been damaged seriously because she wasn't vaccinated against measles. (Her mother being anti-vaxx).
[LanX]: Contrary to Olivia newton John I don't like physical confrontations ...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2017-12-13 18:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (373 votes). Check out past polls.

    Notices?