in reply to Re^2: Uninitialized Value
in thread Uninitialized Value
Is there a way for the code to ignore the whitespace or any type of null in the data file?
while (<FILE>) { if ($_ =~ /^$/) { print "it's blank\n"; next; #process next line } else { print "it's NOT blank\n"; } }
if($_ =~ /^$/) can also be written as if(/^$/)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Uninitialized Value
by marinersk (Priest) on May 18, 2015 at 19:13 UTC | |
|
Re^4: Uninitialized Value
by Not_a_Number (Prior) on May 18, 2015 at 20:07 UTC |