in reply to Difference between $1 and \1.
$<*digits*> ($1, $2, ...):
Contains the subpattern from the corresponding set of capturing
parentheses from the last successful pattern match, not counting
patterns matched in nested blocks that have been exited already.
These variables are read-only and dynamically-scoped.
While \1 :
is Backreference to a specific capture group or buffer. Please also check perlre.
It is also a good thing to note this Warning on \1 Instead of $1
UPDATE I: I was only checking this on Win OS. Thanks to LanX comments below.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Difference between $1 and \1. (perldoc -v)
by LanX (Saint) on Dec 27, 2012 at 12:20 UTC | |
by rbala (Acolyte) on Dec 27, 2012 at 14:08 UTC | |
by Anonymous Monk on Dec 27, 2012 at 14:11 UTC |