Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Inserting an array in an array of hashes

by toolic (Chancellor)
on Oct 18, 2012 at 17:28 UTC ( #999782=note: print w/ replies, xml ) Need Help??


in reply to Inserting an array in an array of hashes

perldsc

use warnings; use strict; my @file_attachments = ( {file => 'test1.zip', price => ['10.00'], desc => 'the +1st test'}, {file => 'test2.zip', price => ['12.00', '12.50'], desc => 'the +2nd test'}, {file => 'test3.zip', price => ['13.00'], desc => 'the +3rd test'}, {file => 'test4.zip', price => ['14.00'], desc => 'the +4th test'} ); for (0 .. 3) { print "@{ $file_attachments[$_]{price} }\n"; } __END__ 10.00 12.00 12.50 13.00 14.00


Comment on Re: Inserting an array in an array of hashes
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2014-10-31 15:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (219 votes), past polls