http://www.perlmonks.org?node_id=1002470

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 ?