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