develooper Front page | perl.perl5.porters | Postings from September 2011

[perl #92898] (*THEN) broken inside condition subpattern

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
September 21, 2011 07:08
Subject:
[perl #92898] (*THEN) broken inside condition subpattern
Message ID:
rt-3.6.HEAD-31297-1316614095-384.92898-15-0@perl.org
On Wed Sep 21 02:17:32 2011, ph10@hermes.cam.ac.uk wrote:
> The fact that (*THEN)
> in these two examples behaves differently is, to me at least,
> counter-intuitive:
> 
>    A (B (*THEN) C)
>    A (B (*THEN) C | D)
> 
> In the first, Perl fails the match without any backtracking if C
> fails;
> in the second, it backtracks into A. Or that is what my experiments
> imply.

Oddly, I don’t find that counterintuitive at all.  Do we need three
versions of prune/then?


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About