use strict; my @people= ( {name=>'Bob'}, {name=>'Carol'} ); foreach my $i ( 0..$#people ) { if ( $people[$i]->{name} eq 'Bob' ) { $people[$i]->{name}='Robert'; # MODIFY $people[$i]->{age}=46; # ADD } }
In reply to Modifying an array of hashes by erabus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |