Hmmm, my understanding was that it stopped *splitting* after the limit, but it
doesn't stop "consuming" the source; rather the entire remainder is returned as
the last item in the list, even if it contains the delimiter. A bit like this:
sub split($pat, $src, $limit) {
@
Carl Mäsak wrote:
> Do not combine 'ne' and '|', like this:
>
> die "Unrecognized directive: TMPL_$directive"
>if $directive ne 'VAR' | 'LOOP' | 'IF';
> One is tempted to assume that this means the same as "$directive ne
> 'VAR' || $directive ne 'LOOP' || $directive ne 'IF"", but it doesn't.
On Tue, 30 Sep 2008, Patrick R. Michaud wrote:
> Just for pedantic clarity, what C< $directive ne 'VAR' & 'LOOP' & 'IF' >
> really gives is
>
> all( $directive ne 'VAR', $directive ne 'LOOP', $directive ne 'IF' )
>
> In other words, the result of the expression is an all() Junction. In
> boole
On Tue, Sep 30, 2008 at 02:31:46PM +1000, Jacinta Richardson wrote:
> Carl Mäsak wrote:
> > The "correct" form using junctions would be this:
> >
> > die "Unrecognized directive: TMPL_$directive"
> >if $directive ne 'VAR' & 'LOOP' & 'IF';
>
> which makes sense, because this does give us:
>
>