Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Test Presence of Data in Hash

by poolpi (Hermit)
on Jul 21, 2009 at 12:08 UTC ( [id://781934]=note: print w/replies, xml ) Need Help??


in reply to Test Presence of Data in Hash

If you need to compare a hash against a (empty) hash ;)

#!/usr/bin/perl use strict; use warnings; use Data::Compare; my %h1 = ( 1 => 'boo', 2 => 'bar', 3 => 'baz' ); my $c = new Data::Compare( \%h1, {} ); print '%h1 is ', $c->Cmp ? '' : 'not ', "empty.\n";


hth,
PooLpi

'Ebry haffa hoe hab im tik a bush'. Jamaican proverb

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-25 08:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found