Hey Tim,
  This will check for lines that have nothing but white space in them and skip them.  
White space
includes newlines as well...

Shawn

open(F,'file.txt');
while(<F>) {
  next if(/^\s*$/);
  blah...
}
close(F);


----- Original Message -----
From: "Booher Timothy B 1stLt AFRL/MNAC" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 02, 2002 4:18 PM
Subject: find blank line


> When parsing a text file - what is the best way to skip a "blank" line -
> when I find the length I get a length of 1 (perhaps the newline). I know
> that I could chomp($_) and then if(length($_) != 0) {do something} else
> {next} but I feel that there should be a way to have an if($_ = $blank)
> statement.
>
> Any thoughts . . .
>
> tim
>
> ____________________________________________________
> Timothy B Booher, Lt USAF, AFRL/MNAC
> 101 West Eglin Blvd, Suite 339
> Eglin AFB FL 32542-6810
> Phone: 850-882-8302 Ext. 3360 (DSN 872-)
> FAX: 850-882-2201
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to