Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Return a var from one sub to another

by philcrow (Priest)
on Jul 10, 2007 at 20:29 UTC ( #625923=note: print w/replies, xml ) Need Help??


in reply to Return a var from one sub to another

Your foo only returns one value which is a reference to a hash (which is a common technique). To get the values, use a bit more notation, something like so:
sub goo { my $var = foo(); print "var is $var->{ message }\n" if $var->{error}; }
The Gantry Web Framework Book is now available.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://625923]
help
Chatterbox?
[GotToBTru]: ah yes that infamous poison di-hydrogen oxide
[Corion]: :-D
[Corion]: Di-hydrogen monoxide is even worse!

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (11)
As of 2016-12-06 12:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (103 votes). Check out past polls.