On Wed, Sep 18, 2002 at 05:01:35PM +0200, Damian Conway wrote:
> Steve Fink wrote:
> > print "yes" if "helo" =~ /hel { .pos-- } lo/;
>
> This definitely has to work. But remember the call to C is on
> the "match object" (i.e. $0), not the string.
>
> Actually, I would expect that *any* pattern
On Wed, Sep 18, 2002 at 05:01:35PM +0200, Damian Conway wrote:
> Steve Fink wrote:
>
> >What possible outputs are legal for this:
> >
> > "aaa" =~ /( a { print 1 } | a { print 2 })* { print "\n" } x/
>
> Unless Larry specifies a required semantics, there are potentially very
> many acceptable o
On Mon, Sep 16, 2002 at 10:32:17AM +0300, Markus Laire wrote:
> On 15 Sep 2002 at 22:41, Steve Fink wrote:
>
> Your code seems to backtrack to the beginning at every failure. First
> code only backtracks one char at time.
> > Huh? What implementation is that? I think my naive implementation
> >
On Fri, 20 Sep 2002, Sean O'Rourke wrote:
: On Fri, 20 Sep 2002, Larry Wall wrote:
: > But if a fast implementation needs to keep pointers into a string
: > rather than offsets from the beginning, we're asking for core dumps if
: > the string is modified out from under the pointers, or we have to
On Fri, 20 Sep 2002, Larry Wall wrote:
> But if a fast implementation needs to keep pointers into a string
> rather than offsets from the beginning, we're asking for core dumps if
> the string is modified out from under the pointers, or we have to
> adjust all known pointers any time the string ma
On Sun, 15 Sep 2002, Steve Fink wrote:
: What should this do:
:
: my $x = "the letter x";
: print "yes" if $x =~ /the { $x .= "!" } .* !/;
Depends. I think it may be necessary for speed and safety reasons
to set COW on the string we're matching, so that you're always matching
against the or
On Wed, 18 Sep 2002, Luke Palmer wrote:
> On Wed, 18 Sep 2002, Josh Jore wrote:
> > On Wed, 18 Sep 2002, Damian Conway wrote:
> > > > What possible outputs are legal for this:
> > > >
> > > > "aaa" =~ /( a { print 1 } | a { print 2 })* { print "\n" } x/
> >
> > I take it that what I've learned f
Josh Jore wrote:
>>>Would it be correct for this to print 0? Would it be correct for this
>>>to print 2?
>>>
>>> my $n = 0;
>>> "aargh" =~ /a* { $n++ } aargh/;
>>> print $n;
>>
>>Yes. ;-)
>
> Wouldn't that print 2 if $n is lexical
Err. It *is* lexical in this example.
> and 0 if it's local
On Wed, 18 Sep 2002, Josh Jore wrote:
> On Wed, 18 Sep 2002, Damian Conway wrote:
>
> > > Would it be correct for this to print 0? Would it be correct for this
> > > to print 2?
> > >
> > > my $n = 0;
> > > "aargh" =~ /a* { $n++ } aargh/;
> > > print $n;
> >
> > Yes. ;-)
>
> Wouldn't that
On Wed, 18 Sep 2002, Damian Conway wrote:
> > Would it be correct for this to print 0? Would it be correct for this
> > to print 2?
> >
> > my $n = 0;
> > "aargh" =~ /a* { $n++ } aargh/;
> > print $n;
>
> Yes. ;-)
Wouldn't that print 2 if $n is lexical and 0 if it's localized? Or are
lexic
Steve Fink wrote:
> What should this do:
>
> my $x = "the letter x";
> print "yes" if $x =~ /the { $x .= "!" } .* !/;
>
> Does this print "yes"?
If it's allowed at all, I think the match should succeed.
> print "yes" if "helo" =~ /hel { .pos-- } lo/;
This definitely has to work. But r
11 matches
Mail list logo