Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: How Do I End Up With a Larger Number of Hash Keys Here?

by BillKSmith (Monsignor)
on Mar 06, 2020 at 16:29 UTC ( [id://11113911]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How Do I End Up With a Larger Number of Hash Keys Here?
in thread RESOLVED - Autovivification: How Did I End Up With a Larger Number of Hash Keys Here?

Its probably to late, but I do want to point out that your original code would work as intended (and perhaps even be clearer) if you test the levels separately. The "short circuit" feature of the "and" operator prevents the troublesome low-level test from running unless the upper-level key exists.
if ( exists $auto_picks{ $data[0] } and exists $auto_picks{ $data[0] }{ $data[1] } ) {
Bill

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 15:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found