Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 ( [id://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

Replies are listed 'Best First'.
Re^3: How best to tell when my hash is "full" (all values defined)?
by BrowserUk (Patriarch) 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.
Re^3: How best to tell when my hash is "full" (all values defined)?
by ikegami (Patriarch) on Dec 18, 2006 at 15:50 UTC

    Yes. It should be

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

    (which can be simplified).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-18 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found