in reply to Warnings Are Good! Plus A Question about $1

Reading the perlre man page will put hair on your chest (and for those already endowed, closer reading can cause graying). Here's a relevant nugget:
The bracketing construct "( ... )" creates capture buffers. To refer to the digit'th buffer use \<digit> within the match. Outside the match use "$" instead of "\". (The \<digit> notation works in certain circum­ stances outside the match. See the warning below about \1 vs $1 for details.) Referring back to another part of the match is called a backreference.
In other words, use "backslash-digit" to refer to a paren'ed chunk while you're still in the left side of the expression, use "dollar-digit" to place a chunk in the replacement pattern.

Replies are listed 'Best First'.
Re: Re: Warnings Are Good! Plus A Question about $1
by petdance (Parson) on Apr 07, 2002 at 15:38 UTC
    Reading the perlre man page will put hair on your chest

    I'd imagine that kudra has already read the perlre man page, so can we assume that...

    xoxo,
    Andy
    --
    <megaphone> Throw down the gun and tiara and come out of the float! </megaphone>