Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Printing from a hash table

by soonix (Canon)
on Jun 03, 2020 at 08:51 UTC ( #11117633=note: print w/replies, xml ) Need Help??

in reply to Printing from a hash table

  • As haukex already stated, exists is superfluous, as keys can give you existing keys only, to loop over
  • for this purpose, undef and empty (and zero) are to be handled the same, you can simply test if/unless $birthdays{$name}. See Scalar values in perldata:
    A scalar value is interpreted as FALSE in the Boolean sense if it is undefined, the null string or the number 0 (or its string equivalent, "0"), and TRUE if it is anything else. The Boolean context is just a special kind of scalar context where no conversion to a string or a number is ever performed.
(and just as I am composing this, Tux beat me to it :-) too much research and interruptions :-(

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2021-03-07 12:33 GMT
Find Nodes?
    Voting Booth?
    My favorite kind of desktop background is:

    Results (121 votes). Check out past polls.