in reply to The value of pattern match variable $&
Much better instead to use explicit locally-scoped variables, and capturing parentheses, eg:
my ($prematch, $match, $postmatch) =~ /^(foo)(bar)(baz)$/;
Cheers,
Darren :)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: The value of pattern match variable $&
by spiritway (Vicar) on May 15, 2006 at 14:34 UTC | |
by ikegami (Patriarch) on May 15, 2006 at 15:07 UTC |