my $x = ""; if($x!~//g) { print "\n There is true data\n"; } #### my $x = " "; # just spaces if($x!~/\s+/g) { print "\n There is true data\n"; }