Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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!
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?
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 imbibing at the Monastery: (9)
As of 2015-07-08 00:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls