Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: Returning hash reference from a sub

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


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

The line %final_data = @loop_data will take the array and map the elements:

my @a = ('H','e','l','o'); my %fus = @a;
so you will get
%fus: H -> e, l -> o
In case you assign an odd list to %final_data the code will break!
What about crating and array of hashes? and return the reference to the array?


Comment on Re^4: Returning hash reference from a sub
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2015-07-05 20:47 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 (68 votes), past polls