in reply to Re: using $ARGV without arguments in thread using $ARGV without arguments
Question on acceptable practice.
Subject, warning on Use of uninitialized value in string eq at ...
When this happens, I go back and check my code to make sure it is OK the value is sometimes unitialized.
If it OK, I move on and dont worry about it.
Is this a bad habit???
Re: Amateur Perl Hacker
by hsmyers (Canon) on Jun 25, 2003 at 14:15 UTC
|
Yes. Lots of Famous Really Good Programmers (tm) will tell you to always initialize vars---but since I'm not one of them, I'll tell you to at least try and make it a habit since it will save you grief later on. My rule is that if there is a chance that I'll check the value before I stuff something in it, I'll usually set it to a known value...
--hsm
"Never try to teach a pig to sing...it wastes your time and it annoys the pig." | [reply] |
|