http://www.perlmonks.org?node_id=11135039

newperldeveloper has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to replace the underscore with backslash underscore. However it is adding an extra backslash to the string.
my $file="Bob_Smith"; $file =~ s/_/\\_/g;
Bob_Smith becomes Bob\\_Smith.