Friday, March 25, 2011

Perl check for empty string

To check if string is empty (with multiple spaces)

my $product =" ";

if(defined($product) && $product!~( /^\s*$/ )){

print ("This is Not a balnk product");

}else{

print ("This is a balnk product");
}

No comments: