in reply to AoA Selective Element Substitution
The following code changes the contents of $array (replacing your map line):
for ( @$array ) { $_->[0] = $test if $_->[0] =~ m/\D/; }
As a one liner, if that's important to you:
$_->[0] =~ m/\D/ and $_->[0] = $test for @$array;
|
|---|