in reply to Length of first captured match
local our $length; $x =~ /(\d+)(?{ $length = length($1) })$/; [download]
or in Perl 5.8:
local our $length; $x =~ /(\d+)(?{ $length = length($^N) })$/; [download]