in reply to Length of first captured match

You said:
my $x = 'abc12345'; my $length = length ($x =~ /(\d+)$/); # returns 1, the length of the number in the number of elements
That's not true. length() imposes scalar context on its argument, so the pattern match happens in scalar context and returns "1" on success and "" on failure. Thus, you're getting length(1), which is 1, not "length of the number in the number of elements", because "number of elements" is not what the regex is returning.

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart