in reply to What does belg4mit's signature do?

e.g. input: don;t output: don't

perl -MO=Deparse -wpe "s/\b;([mnst])/'$1/g" BEGIN { $^W = 1; } LINE: while (defined($_ = <ARGV>)) { s/\b;([mnst])/'$1/g; } continue { print $_; } -e syntax OK

Replies are listed 'Best First'.
Re^2: What does belg4mit's signature do?
by cog (Parson) on Oct 01, 2004 at 11:35 UTC
    Weird...

    $ perl -MO=Deparse -wpe "s/\b;([mnst])/'$1/g" BEGIN { $^W = 1; } LINE: while (defined($_ = <ARGV>)) { s/\b;([mnst])/'/g; } continue { print $_; } -e syntax OK

    Where did my $1 went to? :-|

    This should be something trivial, but... my $1 is disappearing... :-| I'm going from "don;t" to "don'" :-|

    Wasn't ' the same thing as ::?

      Your shell has interpolated $1 before it came to perl

      You may try perl -MO=Deparse -wpe 's/\b;([nmst])/\'$1/g'