Re: access values in array of hashrefs

2008-05-30 Thread Gunnar Hjalmarsson
Ryan wrote: my $HHs=[ {Rx => 'test', key2 => '1st second key' }, {Rx => '2nd1', key2 => '2nd second key' }, {Rx => '3rd1', key2 => '3rd second key' } ]; say join(', ', @{$HHs->{Rx}}); # say all the values of the 'Rx' key in each element of @$HHs. Is there an easy way to do what I

Re: access values in array of hashrefs

2008-05-30 Thread Rob Dixon
Ryan wrote: > my $HHs=[ > {Rx => 'test', key2 => '1st second key' }, > {Rx => '2nd1', key2 => '2nd second key' }, > {Rx => '3rd1', key2 => '3rd second key' } > ]; > > say join(', ', @{$HHs->{Rx}}); # say all the values of the 'Rx' key in > each element of @$HHs. > > Is there a

access values in array of hashrefs

2008-05-30 Thread Ryan
my $HHs=[ {Rx => 'test', key2 => '1st second key' }, {Rx => '2nd1', key2 => '2nd second key' }, {Rx => '3rd1', key2 => '3rd second key' } ]; say join(', ', @{$HHs->{Rx}}); # say all the values of the 'Rx' key in each element of @$HHs. Is there an easy way to do what I

Re: array of hashrefs

2005-11-06 Thread Shawn Corey
Octavian Rasnita wrote: Hi, I have tried the following test program: my @array = ( {a => 'aaa', b => 'bbb',}, {a => 'ala', b => 'bala',}, ); my @array2 = @array; $array2[0]{a} = 'nanan'; push(@array2, 'test'); use Data::Dumper; print Dumper [EMAIL PROTECTED]; The result was: $VAR1 = [

Re: array of hashrefs

2005-11-05 Thread Xavier Noria
On Nov 5, 2005, at 16:44, Octavian Rasnita wrote: I know why modifying an element from a hashref from the second array modifies that element in the first array and why the new pushed element in the second array is not shown in the first array, but I don't know how to create a second array wi

Re: array of hashrefs

2005-11-05 Thread John Doe
Octavian Rasnita am Samstag, 5. November 2005 16.44: > Hi, Hi > I have tried the following test program: > > my @array = ( > {a => 'aaa', b => 'bbb',}, > {a => 'ala', b => 'bala',}, > ); > > my @array2 = @array; > [...] > but I don't know how to > create a second array with all the elements of

array of hashrefs

2005-11-05 Thread Octavian Rasnita
Hi, I have tried the following test program: my @array = ( {a => 'aaa', b => 'bbb',}, {a => 'ala', b => 'bala',}, ); my @array2 = @array; $array2[0]{a} = 'nanan'; push(@array2, 'test'); use Data::Dumper; print Dumper [EMAIL PROTECTED]; The result was: $VAR1 = [ { 'a' =>