Hi,
I have used Data::Dumper to get the hash. I can test myself that the hash is empty.
But how can test in by script that the hash is empty?

Regards,
Suvajit

[EMAIL PROTECTED] wrote:

HI,

You can use Data::Dumper And print the hash reference as,

use Data::Dumper
print Dumper ($preCommands);

If the output is VAR1= {};

Then there are no entries in the has tables

HTH

Regards,
Shaman




-----Original Message-----
From: Suvajit Sengupta [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 16, 2005 4:33 PM
To: Perl Beginners List
Subject: Check empty hash

Hi,
How can I test whether a hash is empty or not ?
For e.g: I have reference to a hash , say $preCommand and I get
             $preCommands  as {} ,
             Its an empty hash, but it exists and is also defined.
I need to check whether the hash is empty or not.
Does anyone has any clue ?

Regards,
Suvajit

--
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/>
<http://learn.perl.org/first-response>





Confidentiality Notice

The information contained in this electronic message and any attachments to 
this message are intended
for the exclusive use of the addressee(s) and may contain confidential or 
privileged information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to