in reply to Finding match offsets of named captures in 5.10 regex
Obviously not a universal solution, but may be insertion of a (?{ code }) block could be helpful:
$_ = 'I am sample'; while (m/(?<be>am)(?{say pos})/ig) { say $+{be}; } [download]