Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^5: Returning hash reference from a sub

by tobias_hofer (Friar)
on Mar 18, 2013 at 14:13 UTC ( #1024057=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Returning hash reference from a sub
in thread Returning hash reference from a sub

Hi, this won't work as you use the same keys.

$VAR1 = { 'names' => 'mary', 'names' => 'john', 'names' => 'Doe', 'names => '' };
Better try to make an array of hashes which would look like this:
$VAR1 = [ { 'names' => 'mary'}, { 'names' => 'john'}, { 'names' => 'Doe'}, { 'names => ''} ];
or
$VAR1 = { 'names' => ['mary','john','Doe','']}; ];


Comment on Re^5: Returning hash reference from a sub
Select or Download Code
Re^6: Returning hash reference from a sub
by Anonymous Monk on Mar 18, 2013 at 14:29 UTC
    I know, wish it could be return as:
    $VAR1 = { 'names' => 'mary'}, { 'names' => 'john'}, { 'names' => 'Doe'}, { 'names => ''} ;
    }, {

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2015-07-07 06:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls