in reply to tagging question

Here is a snippet:
my $x='il yadayadayada'; $x=~s/^(\w{2})(.*)/<$1> $1$2 <$1>/; print $x; -- output -- <il> il yadayadayada <il>
Update:beable's (++) nit noted and picked.

    Earth first! (We'll rob the other planets later)

Replies are listed 'Best First'.
Re^2: tagging question
by beable (Friar) on Jul 23, 2004 at 23:17 UTC
    Dude, the output is supposed to be:
    <il> il yadayada <il>
    . Therefore, you should have written this:
    $x=~s/^(\w{2})(.*)/<$1> $1$2 <$1>/;
    </nitpick>