Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Debugging "Use of uninitialized value" warnings.

by gloryhack (Deacon)
on Apr 04, 2007 at 04:17 UTC ( #608201=note: print w/replies, xml ) Need Help??

in reply to Debugging "Use of uninitialized value" warnings.

Defensive code is the difference between fragility and robustness.
  • Comment on Re: Debugging "Use of uninitialized value" warnings.

Replies are listed 'Best First'.
Re^2: Debugging "Use of uninitialized value" warnings.
by cwry (Monk) on Apr 04, 2007 at 04:24 UTC

    Agreed. I generally try to code defensively, but in the context of my original question, I am trying to make the defensive code implicit (Perl automatically tells me when and where I used an uninitialized variable) rather than explicit (adding code to check if a variable is unitialized then dying/warning if it is).

    Both have the same result, but I think the former results in cleaner code.

      It'd be a handy feature to have, certainly, but I'm not aware of any easy way to get it. If there were a pragma to turn on verbose warnings of that kind, I'd have a new love.

      My wife might not like it, though, because I'd spend all of my days and nights just gazing lovingly at perl...

        You mean no warnings 'uninitialized';?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://608201]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2017-11-20 23:58 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (294 votes). Check out past polls.