http://qs1969.pair.com?node_id=11140441

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

How do our code evaluations in regex refer to the regex group captured, by name and/or relative way ? Try such
'foo' =~ /(?'name'(?=o)(\w+))(?{print $name})/ # or 'foo' =~ /(?'name'(?=o)(\w+))(?{print $-1})/ Number found where operator expected at (eval 23)
to only get failure.
How is the correct Perl's way ?