in reply to Re: adding an element to AoH
in thread adding an element to AoH
Umm, that does exactly the same thing:
use Data::Dumper; use Test::More qw(no_plan); $AoH[0]->{heading}->[3]->{item} = 'eee'; print Dumper @AoH; $BoH[0]->{heading}->[3] = {item => 'eee'}; print Dumper @BoH; is_deeply(@AoH,@BoH,"They're the same");
Output:
$VAR1 = { 'heading' => [ undef, undef, undef, { 'item' => 'eee' } ] }; $VAR1 = { 'heading' => [ undef, undef, undef, { 'item' => 'eee' } ] }; ok 1 - They're the same 1..1
|
|---|