Thanks so much - only one problem: when I try to use while (my $line =
<MYFILE>) { etc } I get a bunch of errors similar to this one:

Use of uninitialized value at JustForTest.pl line 13, <MYFILE> chunk 5.

Do you know what I am doing wrong?

Thanks,

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

 -----Original Message-----
From:   Hanson, Robert [mailto:[EMAIL PROTECTED]] 
Sent:   Wednesday, January 02, 2002 4:27 PM
To:     'Booher Timothy B 1stLt AFRL/MNAC'; [EMAIL PROTECTED]
Subject:        RE: find blank line


One way is to do this...

while ( my $line = <FILE> ) {
        next if ( /^\s*$/ );
}

Rob

-----Original Message-----
From: Booher Timothy B 1stLt AFRL/MNAC
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 02, 2002 5:19 PM
To: [EMAIL PROTECTED]
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

Reply via email to