develooper Front page | perl.beginners | Postings from April 2008

how to check null value

Thread Next
From:
Irfan.Sayed
Date:
April 22, 2008 01:09
Subject:
how to check null value
Hi All,

 

How to find out whether the string contains null values or empty data.

 

For example : I have one scalar variable $str and now I want to check
whether it contains any data or not.

 

What I did  : If ($str eq "NULL" || $str eq " "){ print $str conatins
nothing\n";}

 

Is this correct?? Because doing as per above code , I am not getting
proper result.

 

Please help

 

Regards,

Irfan

 



Thread Next


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About