Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Inserting an array in an array of hashes

by toolic (Bishop)
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://999782]
help
Chatterbox?
[marto]: what a day, running on 2 hours broken sleep. sick twins -- :P

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2017-11-18 18:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (277 votes). Check out past polls.

    Notices?