perl -E 'sub foo { local $_ = shift; m{(?\d++)}; say "IN ", @+{qw(a)}; return @+{qw(a)} } say "OUT ",foo("12.34.56");' IN 12 OUT