Keep It Simple, Stupid | |
PerlMonks |
offset of named capture bufferby mhgoeschl (Novice) |
on Nov 06, 2012 at 13:04 UTC ( [id://1002470]=perlquestion: print w/replies, xml ) | Need Help?? |
mhgoeschl has asked for the wisdom of the Perl Monks concerning the following question:
Hi, using @- and @+ I can get the _offset_ information of any capture porvided I know its ordinal number in the capture list, e.g. $-[2] for (un-named) backref $2. If I work with named backrefs, e.g. (?<myref>), I can easily get its _content_ via $+{myref}. Now, I am seeking to access the _offset_ values of a named backref given its name (here: 'myref') only ? An alternative route would be knowing the ordinal capture number corresponding to a named backref (such that I could access its offset information via the @-/@+ lists). Any idea how to do this ?
Back to
Seekers of Perl Wisdom
|
|