in reply to Implicit context conversion error, brain.pl line 666

This is why you should always use strict and lexical variables (aka my $x). Using strict would have helped you realize that the variables were not lexically scoped. Plus it's just good programming practice. :-) I use strict even on my throwaway scripts these days.
  • Comment on Re: Implicit context conversion error, brain.pl line 666

Replies are listed 'Best First'.
Re(2): Implicit context conversion error, brain.pl line 666
by FoxtrotUniform (Prior) on Apr 03, 2002 at 15:07 UTC
      This is why you should always use strict and lexical variables (aka my $x).

    You'll notice that my habit of using strict is what caught the error in the first place. :-)

    (As for lexicals, I plead PHP brain damage.)

    Update: Given the choice, I wouldn't be using PHP, but the Powers That Pay My Salary "asked" me to.

    Far from the worst language I've ever dealt with, but IMO that's damnation by faint praise.

    --
    :wq

      I didn't see "use strict" in the snippet so I made an assumption.

      And we'll let you off w/ a warning this time. But next time we catch you fooling around with that PHP stuff we'll throw the book at you. :-)