Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: returning a hash from a module

by sundialsvc4 (Abbot)
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.

Replies are listed 'Best First'.
Re^2: returning a hash from a module
by Lotus1 (Curate) 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021155]
[Corion]: The data is the game ;)
[marto]: good morning all
[hippo]: Great slogan :)
[Corion]: Hi marto ;)
[mxb]: Hi all.
[Discipulus]: Hi marto
Discipulus mmh .oO(perl data chess.. 8 scalar, 2 arrays, 2 hashes, 2 refernses, 1 typeglob and atied scalar)

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2018-03-19 09:26 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (236 votes). Check out past polls.