Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I would like to access the data in this array and have the results as:$VAR1 = [ { 'name' => 'Discount', 'reference' => '100 ', 'type' => 'Paper' }, { 'name' => 'Documents', 'reference' => '100 ', 'type' => 'Paper' }, { 'name' => 'Money', 'reference' => '340 ', 'type' => 'Plastic' }, { 'name' => 'State', 'reference' => '40 ', 'type' => 'Cotton' }, { 'name' => 'Slice', 'reference' => '30 ', 'type' => 'Cotton' }, { 'name' => 'Part', 'reference' => '45 ', 'type' => 'Cotton' }, ]
for ( @{ $my_array } ) { print "$_\n"; } print "Results: Paper: Discount - 100 Documents - 100 Plastic: Money - 340 Cotton: State - 40 Slice - 30 Part - 45
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Accessing this array ref.
by SuicideJunkie (Vicar) on Apr 03, 2013 at 18:41 UTC | |
by Anonymous Monk on Apr 03, 2013 at 18:57 UTC | |
by SuicideJunkie (Vicar) on Apr 03, 2013 at 19:20 UTC | |
Re: Accessing this array ref.
by Loops (Curate) on Apr 03, 2013 at 18:58 UTC | |
by Anonymous Monk on Apr 03, 2013 at 19:23 UTC | |
by Cristoforo (Curate) on Apr 03, 2013 at 19:52 UTC | |
by Anonymous Monk on Apr 03, 2013 at 20:05 UTC | |
by Anonymous Monk on Apr 03, 2013 at 20:37 UTC | |
| |
Re: Accessing this array ref.
by hdb (Monsignor) on Apr 03, 2013 at 21:30 UTC | |
Re: Accessing this array ref.
by arnaud99 (Beadle) on Apr 04, 2013 at 07:37 UTC | |
Re: Accessing this array ref.
by TJPride (Pilgrim) on Apr 04, 2013 at 12:34 UTC |