reptile has asked for the wisdom of the Perl Monks concerning the following question:

This is strange and I can't figure out why it would be doing this. I have perl 5.00405 which I know includes lookbehind assertions, but nonetheless, gives me this error:

if ( /(?<!foo)bar/ ) Sequence (?<...) not recognized at - line 1.

Does anyone have a clue why this would happen? I'm using the same example given on the perlre manpage from the 5.00401 docs and it doesn't work.

Replies are listed 'Best First'.
Re: Lookbehinds not recognized?
by chromatic (Archbishop) on May 14, 2000 at 04:13 UTC
    After checking perldelta for 5.005_3 and Elements of Programming with Perl, I have to conclude that lookbehind assertions were introduced in 5.005. Lookaheads were around before that, though.

    As to why perlre for 5.004 shows that -- your guess is as good as mine.

      I guess you're right. 5.005 works, I just installed it. I have no idea why the 5.004 docs say it was in there. Looks like I'm spending the rest of the night reinstalling modules.

      Thanks.

      it seems to have been added in 5.004_50, which i think is a prerelease of the 5.005 series. here's the relevant message from perl5-porters. see item (k).
Re: Lookbehinds not recognized?
by httptech (Chaplain) on May 14, 2000 at 06:47 UTC
    I had a similar question a few days ago, and mdillon gave me some examples

    But you will need to upgrade Perl as he stated above.

RE: Lookbehinds not recognized?
by undefined (Novice) on May 15, 2000 at 03:41 UTC
    Hello!

    Are you using perldoc on your system or the Perl Monks web version? I *think* (look at Perl Monks perldelta page) the web version you reference is really 5.005 rather than 5.004 which may be your problem. I tried it out on 5.005_03 and it works as it should. I dont have an older version so I can't say for sure...

    Good Luck with it!!

    Check out Knexa.com
    KNowledge EXchange Auction (Preview Release)