>>>>> "Timothy" == Timothy Johnson <[EMAIL PROTECTED]> writes:

Timothy> Try this:

Timothy> open(INFILE,"myfile.txt");
Timothy> open(OUTFILE,"SSlines.txt");
Timothy> while(<INFILE>){
Timothy>    unless($_ eq "\n"){  #blank lines probably have only a \n
Timothy>       print OUTFILE $_;
Timothy>    }
Timothy> }

The "probably" is spooky there.  "is blank" or "looks blank" are
two different things.  Yours is fine for "is blank".  For "looks blank",
just accept the ones that have /\S/ somewhere:

        while (<INFILE>) {
                print OUTFILE if /\S/;
        }

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

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

Reply via email to