Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Array of hashes of values AND Arrays of Hashes

by busunsl (Vicar)
on Oct 11, 2002 at 12:33 UTC ( [id://204480]=note: print w/replies, xml ) Need Help??


in reply to Array of hashes of values AND Arrays of Hashes

Something like:
$array[1]->{Contact} = []; %hash = ( Contact_Tel => '1234', Contact_Name => 'Mr. Bean'); push @{$array[1]->{Contact}}, \%hash;
$array[1]->{Contact} contains the reference to an empty array.
Since push requires a 'real' array as its first argument, you have to dereference the reference in $array[1]->{Contact}.
You do this with @{...}.

See: here and here for more.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-19 22:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found