in reply to Irregular expression evaluation

As pg demonstrates, you have created an inadvertent closure. This issue has come up before. I'm wondering if it might be appropriate for perl to issue a warning here. It can be a nasty bug.

-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re^2: Irregular expression evaluation
by pg (Canon) on Oct 24, 2005 at 04:40 UTC

    Fully agree with you and there better be a warning.

    Closure was meant to be a feature, so that people can use it when they need it (and they KNOW that they are using it). But so often people just get trapped without knowing that there is a closure in their code, and it becomes very tricky to application programmers.

    A warning in this case will be very helpful.

      dave_the_m has been working on the closure code so its quite possible this warns in blead. I know he has made improvements in that area.

      ---
      $world=~s/war/peace/g