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

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.

Replies are listed 'Best First'.
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.
        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.
        I could use something like that for all that apply as well, right?

        if(defined $_->{ TEST33 } && $_->{ TEST34 } && $_->{ TESTX33 }) { <Previous code here ...> }

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2018-04-19 20:40 GMT
Find Nodes?
    Voting Booth?