in reply to Length of first captured match

Here is a minor variation of Tanktalus' solution. I prefer this because it leaves $length as "undef" on no match.
my $length = length $1 if $x =~ /(\d+)$/;

     "For every complex problem, there is a simple answer ... and it is wrong." --H.L. Mencken

Replies are listed 'Best First'.
Re^2: Length of first captured match
by Limbic~Region (Chancellor) on May 06, 2006 at 14:34 UTC