Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: A Warning Issue!

by thezip (Vicar)
on Feb 19, 2008 at 16:38 UTC ( #668833=note: print w/ replies, xml ) Need Help??


in reply to A Warning Issue!

Since you've explicitly initialized a few of the variables, then only the remaining ones are the potential causes for the warnings, namely $_->{ TEST34 } and $_->{ TEST33 }.

Perhaps you might want to check their values prior to the IF statement to ensure they are what you think they are. If either is not initialized, then just don't execute the IF statement.

BTW, that's a fairly complicated piece of logic there. Maybe you might want to break it up into smaller, logical chunks? That way, you'll have a better idea of what you were trying to do six months down the road.


Your wish is my commandline.


Comment on Re: A Warning Issue!
Re^2: A Warning Issue!
by Anonymous Monk on Feb 19, 2008 at 16:44 UTC
    That's why I am confused, I my head the IF should be doing this check, how would I check otherwise?

      At the risk of adding more bulk to your code, try this check first, as well as one for $_-> { TEST34) }.

      if ($_->{ TEST33 } ) { <your previous code here ...> }

      Your wish is my commandline.
        I could use something like that for all that apply as well, right?

        if(defined $_->{ TEST33 } && $_->{ TEST34 } && $_->{ TESTX33 }) { <Previous code here ...> }
        Just don't forget the implicit assumption here that $_->{TEST33} will never be zero. If zero is a valid (or even possible) value, you probably want to test if (defined $_->{TEST33}) instead.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-12-25 11:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls