in reply to Re: @- and @+ question
in thread @- and @+ question
While im pretty sure you know this, ill mention it for other readers:
@- and @+ are actually thin wrappers around the way that Perl internally tracks where matches and capture buffers start and stop. The variables $& and $1 and friends actually are ties that combine the data in @- and @+ with a copy of the string matched against to produce the magic variables. If you have ever wondered why @- and @+ exist and why they are such strange things its because they are really just tied variables that wrap C arrays*. Larry is on record saying that he considers them a bad interface because of this.
* in Perl 5.9.4 Nicholas Clark merged the two arrays into a single array of structs containing two STRLEN's (long integers).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: @- and @+ question
by Juerd (Abbot) on Jun 19, 2007 at 21:22 UTC | |
by demerphq (Chancellor) on Jun 19, 2007 at 22:35 UTC |