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

Re^2: Not meaning to add values to a hash ("autovivification")

by stu96art (Scribe)
on Dec 21, 2012 at 16:44 UTC ( [id://1009936]=note: print w/replies, xml ) Need Help??


in reply to Re: Not meaning to add values to a hash ("autovivification")
in thread Not meaning to add values to a hash

Thanks. I had used 'exists' before I tried 'defined' with the same results.

What I am trying to accomplish is to only reference the element in the hash if it actually exists. I had also tried to do an if statement where the hash element would have to equal the correct key, but I received a multitude of "Uninitialized value...".

  • Comment on Re^2: Not meaning to add values to a hash ("autovivification")

Replies are listed 'Best First'.
Re^3: Not meaning to add values to a hash ("autovivification")
by Corion (Patriarch) on Dec 21, 2012 at 17:01 UTC

    If one side of the comparison is uninitialized (due to not existing), then Perl warns.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-26 03:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found