map works... but there is a feeling that it is not needed. If I do it, I will simply:
use strict;
use warnings;
use Data::Dumper;
my $AoH_orig = [ { 'title' => 'aaa-aaa',
'name' => 'tom' },
{ 'title' => 'bbb-bbb',
'name' => 'kathy' },
{ 'title' => 'ccc-ccc',
'name' => 'bill' }
];
for (@$AoH_orig) {$_->{'title'} =~ s/-/_/g};
print Dumper($AoH_orig);
Which gives you what you wanted:
$VAR1 = [
{
'name' => 'tom',
'title' => 'aaa_aaa'
},
{
'name' => 'kathy',
'title' => 'bbb_bbb'
},
{
'name' => 'bill',
'title' => 'ccc_ccc'
}
];