Christopher Spears wrote: > I have to write a script that processes text in a > file. The text includes lots of blank lines. How can > I tell Perl to skip the lines? I thought maybe > something like: > > next if ($line =~ /\s+/); > > However, what if the line simply happens to have more > than one whitespace. Even a sentence has whitespace > between the words! Or maybe the line is idented!
next unless $line =~ /\S/; # skip unless it contains non-whitespace -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>