in reply to Re^5: The weirdest problem with undef
in thread The weirdest problem with undef

See, that's exactly the quick hacky fix that I'd deliberately _not_ given you.

Please do it the right way. Pass the lexical variables into the subroutines. There's rarely a good reason to use package variables.

And please use "strict" and "warnings". It'll make it much easier to catch bugs like this in the future.

--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Replies are listed 'Best First'.
Re^7: The weirdest problem with undef
by insaniac (Friar) on Dec 22, 2004 at 10:53 UTC
    hey dave,

    indeed, i know... it's not beautiful et al what i just did... but i needed a quick solution.

    and yes, i should use warnings and use strict (and usually i do), but this script is 3500+ lines and using strict on that script, phieeeuw, it's not good for the faint of heart. ;-) (it was written when i was a total perl newbie ;-) shit.. i still am!!! )

    but i'll try and update some of the subroutines to take the two variables as arguments instead of using the package variables...

    so thanks again for the hard lessons

    --
    to ask a question is a moment of shame
    to remain ignorant is a lifelong shame
      i needed a quick solution
      This weird bug with using package variables made it not so quick eh? Beware of false laziness and false quickness.