in reply to efficient char escape sequence substitution

Funny you should ask, as I just used this code last night. Here's how I did it:
sub de_slashify { my $string = shift; my $esc = { n => "\n", r => "\r", t => "\t", }; $string =~ s/\\([nrt])/$esc->{ $1 }/ge; return $string }
I couldn't tell you if it's more efficient, but it's at least an alternative.

Update:
(On a tip from Animator)
I should point out that this very simple code snippet won't handle all escape sequences, only the (initial) three you asked about. If you need to parse anything that might contain other more complex escape sequences you should probably use a module.