in reply to Re: Substituting in the substitution!
in thread Substituting in the substitution!

Why's the space before the backslash?

Update: ah, I forgot. Perl repeats the last character of the right side of the tr if there are too few. Great.

  • Comment on Re: Re: Substituting in the substitution!

Replies are listed 'Best First'.
Re^3: Substituting in the substitution!
by Roy Johnson (Monsignor) on May 06, 2004 at 19:43 UTC
    Because that way both spaces and slashes get translated into underscores. This strips out the brackets as well:
    $_='[ABC AB AB12/83]'; tr# /[]#__#d; print;

    The PerlMonk tr/// Advocate