Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
XP is just a number
 
PerlMonks  

Re^2: How best to tell when my hash is "full" (all values defined)?

by Hofmator (Curate)
on Dec 18, 2006 at 15:31 UTC ( #590454=note: print w/ replies, xml ) Need Help??


in reply to Re: How best to tell when my hash is "full" (all values defined)?
in thread How best to tell when my hash is "full" (all values defined)?

I'm not sure how your last-condition keys( %hash ) == values( %hash ) works ... isn't this always true for all hashes (the number of keys is equal to the number of values)?

-- Hofmator

Code written by Hofmator and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.


Comment on Re^2: How best to tell when my hash is "full" (all values defined)?
Download Code
Re^3: How best to tell when my hash is "full" (all values defined)?
by ikegami (Pope) on Dec 18, 2006 at 15:50 UTC

    Yes. It should be

    keys( %hash ) == grep defined, values( %hash )

    (which can be simplified).

Re^3: How best to tell when my hash is "full" (all values defined)?
by BrowserUk (Pope) on Dec 18, 2006 at 16:25 UTC

    Yes, of course it should++. I was concentrating on the idea of avoiding accidental autovivification.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2014-04-23 10:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (541 votes), past polls