if ('s' =~ /s/) { # error message may report this line number ... ...; ...; for (qw(q r s t u)) { s{ s }{ t }xms; # ... for error on this line. } ...; ...; } # ... or this line number ...