Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The @+ and @- variables allow you to reference capture buffers by index rather by named variables (e.g. substr($var, $-[2], $+[2] - $-[2]) rather than $2). Similarly %+ allows access to named captures by "index" (the name).
It's not like $+ which is a special name for "whatever the last group was which matched"; $+ always going to refer to whatever the last group was which successfully matched, whereas %+ allows access to all of the named captures. That clear things up? Update: Oop, had @+ twice first sentence; thanks linuxer.
The cake is a lie. In reply to Re: Bug in ' perldoc perlvar ' ?
by Fletch
|
|