sub trx { (my $x = $_[0]) =~ tr/rnbaftv/\r\n\b\a\f\t\013/; $x; } $s =~ s{\\([0-7]{1,3})|\\(.)}{defined $1 ? chr oct $1 : trx $2}eg;