On Mon, May 09, 2005 at 09:47:14AM -0600, Paul Seamons wrote:
: > =item *
: >
: > Quantifiers (except C<?> and C<??>) cause a matched subrule or subpattern to
: > return an array of C<Match> objects, instead of just a single object.
: 
: What is the effect of the quantifiers C<**{0,1}> and C<**{0,1}?> ?

That would be **{0..1} and **{0..1}? actually, since we're treating ..
as a real range and {} as a real closure.  (Though they're presumably
optimized away for constant ranges.)

: Will they 
: behave like ? and ?? and return a single object - or will they cause the 
: quantified subrule or subpattern to return as an array of C<Match> objects?

The latter.  In the abstract it would be nice to define ? in terms of
**{0..1}, but the simple fact is that we can't afford to let **{$n..$m}
change the form of its return value merely because $n just happens
to be 0 and $m just happens to be 1.  And that actually makes the
distinction between ? and **{0..1} more useful, insofar as it lets you
specify which form of return you want.

Larry

Reply via email to