Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: returning a hash from a module

by sundialsvc4 (Monsignor)
on Mar 01, 2013 at 04:58 UTC ( #1021155=note: print w/ replies, xml ) Need Help??


in reply to returning a hash from a module

Since the return-value from a sub must be “one single thing,” it should properly be a hash reference.


Comment on Re: returning a hash from a module
Re^2: returning a hash from a module
by Lotus1 (Chaplain) on Mar 07, 2013 at 19:24 UTC

    Actually, return will return a list, scalar or void depending on the context of the expression after the return statement. So if you return a hash it will flatten it to a list. If there is an assignment of the return value into a hash then the list is put into the hash. Same with arrays.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2014-08-29 05:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (275 votes), past polls