Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by BillKSmith (Prior)
on Mar 06, 2020 at 16:29 UTC ( #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
Node Status?
node history
Node Type: note [id://11113911]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2021-04-18 18:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?