in reply to C strings, unescaping of

That is rather odd sounding to me.
sub trx { (my $x = $_[0]) =~ tr/rnbaftv/\r\n\b\a\f\t\013/; $x; }

The reason is that I've never seen a 'C' trace log with such an ASCII syntax. This doesn't seem to make sense to me.

These \r\n\b\a\f\t\013 are basically "space" characters "\s" as far as Perl regex is concerned with the exception of the "bell character", \a which I'm not exactly sure about.

I haven't seen a 2 lines like:
line1nline2n
How do you differentiate between the "n" between the lines and the "n" within the "line"?

Replies are listed 'Best First'.
Re^2: C strings, unescaping of
by andal (Hermit) on Oct 01, 2013 at 07:38 UTC
    That function is used inside of substitute. There are actually 2 lines of code. Substitute identifies the letters to be replaced and the trx function does actual replacement. At first, it also confused me :)