my $r = reverse $str_no_dash; $str_with_dash =~ s/[^-]/chop $r/ge;