in reply to Length of first captured match

my $length = $x =~ /(\d+)$/ ? length $1 : 0;
While I think this is what you're looking for, I'm just guessing at what the right answer is if there is no match.

Replies are listed 'Best First'.
Re^2: Length of first captured match
by QM (Parson) on May 07, 2006 at 01:21 UTC
    While I think this is what you're looking for, I'm just guessing at what the right answer is if there is no match.
    Actually, there will always be a match, but it's appropriate to worry about null matches.

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of