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

Hi brethren
While updating our environment from Perl 5.6.1 to 5.8.0 I had found something strange:

If you want to replace a regexp with a NaN (or undef or '') with the s-Operator and you have switched on the /e modifier (e.g. s/__I__//e), then Perl 5.8.0 doesn't behave like Version 5.6.1:

5.6.1: __I__ is replaced by nothing
5.8.0: __I__ is replaced by a string (mostly with "1", sometimes with strings from other variables)

Is this a well known behaviour? Where can I find a note about that?

Replies are listed 'Best First'.
Re: s-Operator in Perl 5.8.0
by dave_the_m (Monsignor) on Sep 01, 2004 at 08:05 UTC
    This is fixed in 5.8.1 and later.

    Dave.

      Dave, please could you update your node with a small excerpt from the relevant documentation?

      Thanks

      Ciao!
      --bronto


      The very nature of Perl to be like natural language--inconsistant and full of dwim and special cases--makes it impossible to know it all without simply memorizing the documentation (which is not complete or totally correct anyway).
      --John M. Dlugosz

        Here are some related references in the perlbug database: [perl #17605], [perl #19545], [perl #23227].

        The first of those includes the analysis and fix: at a certain point a bug was introduced that broke any attempt to execute an empty sub, via eval or otherwise. In the worst cases this would cause a coredump.

        Hugo

        Er, there is no relevant documentation

        Dave.

Re: s-Operator in Perl 5.8.0
by davido (Cardinal) on Sep 01, 2004 at 06:46 UTC

    Could you post a small snippet of code (just a few lines) that replicates the problem? I have no idea what string you're binding to the s/__I__//e operator.


    Dave