for ( @$array ) { $_->[0] = $test if $_->[0] =~ m/\D/; } #### $_->[0] =~ m/\D/ and $_->[0] = $test for @$array;