PERL - Array of Hashes?

Amar

New member
Hi,

I am having an Array of Hashes like

my @fileattachments = [

{file => 'test1.zip', price => '10.00', desc => 'the 1st test'},

{file => 'test2.zip', price => '12.00', desc => 'the 2nd test'},

{file => 'test3.zip', price => '13.00', desc => 'the 3rd test'},

{file => 'test4.zip', price => '14.00', desc => 'the 4th test'},

];


I would like to print all the price elements first. How can I make this ???

Please help with the perl code for this.

Thanks in Advance
Sravya
 
What do you mean "first"? Plus, your declaration is syntactically wrong. Array literals are declared with () parentheses, while [] square brackets indicate a reference to an array.

my @a = ();
my $ra = [];

Make sure you have use strict; use warnings; at the top of your program!!! Then ask us again.
 
Back
Top