in reply to (Ovid) Re: What's like $+ but not gives the ordinal?
in thread What's like $+ but not gives the ordinal?
Here is a way that finds the max by itself, as implied by another message on this thread:
In your new code, you are localizing the same name as you are my-ing. What's that for? It's not even used inside the block where it's localized.sub last_paren_match_ordinal() { my $n= scalar @+; # gives number of captures present. while ($n) { no strict 'refs'; last if defined $$n; --$n; } return $n; }
—John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Ovid) Re(3): What's like $+ but not gives the ordinal?
by Ovid (Cardinal) on Jun 28, 2001 at 02:01 UTC | |
by John M. Dlugosz (Monsignor) on Jun 28, 2001 at 02:25 UTC |