in reply to Re: Viewing metasymbols in output?
in thread Viewing metasymbols in output?

or in one line: perl -pe 's/\t/\\t/g' infile > outfile to allow for more substitutions consider a hash like

my %mapping = ( # or whatever you like to display "\t" => '\t', "\n" => '\n', " " => '_', ); my $pattern = qr/([@{[join '', keys %mapping]}])/; while ( <> ) { s/$pattern/$mapping{$1}/g; print "$_\n"; # you still want to start a new line }
This works fine as long as your keys are only characters, otherwise you have to use an alternation instead of a character class.

-- Hofmator