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

Re: How do I make an array of hashes?

by chromatic (Archbishop)
on Mar 31, 2000 at 00:42 UTC ( [id://6552]=note: print w/replies, xml ) Need Help??


in reply to How do I make an array of hashes?

my @array = ( { 'name' => 'Chuck', 'job' => 'roustabout', }, { 'name' => 'CowboyNeal', 'job' => 'code monkey', }, );
You can also use normal array operations (such as push) to modify an array:
push @array, { 'name' => 'vroom', 'job' => 'stacking blocks' }; print $array[0]->{name};
See perlman:perldsc for more information.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found