@s_dn = map { s/NUM/1/; $_ } @s_dn; #### for( @s_dn ) { my $num = 1; # calculate the local num, somehow. s/NUM/$num/g; }