Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: How to test for empty hash?

by GrandFather (Saint)
on Aug 06, 2021 at 01:18 UTC ( [id://11135639]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    print "Not empty: scalar\n" if scalar %hash;
    print "Not empty: 0 != scalar\n" if 0 != scalar %hash;
    print "Not empty: keys\n" if keys %hash;
    
  2. or download this
    v5.32.1
    Empty: !%hash
    ...
    Not empty: scalar
    Not empty: 0 != scalar
    Not empty: keys
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (None)
    As of 2024-04-25 01:53 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found