Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > correct way to check for empty hash

Reply
Thread Tools

correct way to check for empty hash

 
 
justme
Guest
Posts: n/a
 
      10-09-2004
hi

in the perldoc, the way to check for a hash with members is

if ( %hash )
{
print "has elements";
}

but what is the correct way to check for empty hash?

Which is the correct way
1) if (!%hash ) or
2) if (%hash < 1)


or other methods??
thanks...
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
hash of hash of hash of hash in c++ rp C++ 1 11-10-2011 04:45 PM
Can I check the a hash contain another hash in deep check? Siratinee Sukachai Ruby 1 04-22-2011 07:43 PM
Uploaded File Empty but in correct folder with correct name froil Perl Misc 12 03-02-2006 01:21 PM
Check if a directory is empty and empty it Marcia Hon C Programming 8 02-14-2004 03:53 AM
To correct my program. please, check to find errors and correct me. joon Java 1 07-08-2003 06:13 AM



Advertisments