Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Test Presence of Data in Hash

by poolpi (Hermit)
on Jul 21, 2009 at 12:08 UTC ( #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


Comment on Re: Test Presence of Data in Hash
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-11-28 00:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (191 votes), past polls