in reply to Re: Re: Re: Re: What's like $+ but not gives the ordinal?
in thread What's like $+ but not gives the ordinal?

Ah, I must have misread that as "sucessful subgroups were in the last match". Nevermind, then. The docs have this to say about @-:
@- [snip] with `substr $_, $-[$#-], $+[$#-]'. One can use `$#-' to find the last matched subgroup in the last successful match. Contrast with `$#+', the number of subgroups in the regular expression. Compare with `@+'. [snip]


japhy -- Perl and Regex Hacker

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: What's like $+ but not gives the ordinal?
by John M. Dlugosz (Monsignor) on Jun 28, 2001 at 19:32 UTC
    Mine says “You can use $#- to determine how many subgroups were in the last successful match. Compare with the @+ variable.” which is basically the same as @+ and not at all what yours says. Yours matches what I'm seeing in the code.

    Perhaps the doc change didn't make it into the Release version when the code did, or ActiveState goofed in doing patches?

    —John

      Data points: my ActivePerl build 616 has japhy's wording as does my Indigo Perl 5.6.0 (and I recall this difference in the first Perl 5.6 that I installed which was probably ActivePerl build <616).

              - tye (but my friends call me "Tye")
        Curiouser and curiouser! Mine is ActiveState Perl build 626 (Perl 6.5.1 with 1 registered patch), which is newer.

        —John