in reply to Re: Curious result of using "my ... if ..."
in thread Curious result of using "my ... if ..."

Not so much a bug as an unmapped and(possibly) unmappable area of the Perl landscape. What is the sensible behaviour? Personally I think an error is appropriate.


DWIM is Perl's answer to Gödel
  • Comment on Re^2: Curious result of using "my ... if ..."

Replies are listed 'Best First'.
Re^3: Curious result of using "my ... if ..."
by perrin (Chancellor) on May 16, 2007 at 14:45 UTC
    In my opinion, the sensible behavior, and what most people expect when they use it, is that it would operate the same as if the my($x) was on a separate line. If that isn't possible, it should throw an error.
      I agree with you. There are two logical choices: either it should work as you suggest or it should be disallowed by the compiler. But the actual implementation makes no sense whatsoever to me.