Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: uninitialized variables

by the_slycer (Chaplain)
on Mar 28, 2002 at 16:05 UTC ( [id://155016]=note: print w/replies, xml ) Need Help??


in reply to uninitialized variables

All the above are good and probably the recommended way to do things. However, here's another option that I've used in the past.

Instead of using the -w switch, try use warnings (just like use strict). Then, in situations where you *know* that the data might not be there turn warnings off with no warnings before assigning to your variables. Once that bit of code is done, turn it back on using use warnings again.

Maybe not the best way, but convienient when you have a whole whack of variables that you might be assigning to, and don't want to initialize them all to "0".

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://155016]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2024-03-28 11:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found