in reply to Parsing Multiple Lines.
Your routine already distinguishea between data lines and blank (well, nonword) ones. You just haven't used the information. Add an else clause to the end of the if ($line=~/(\w)/) { statement, like:
For other ideas, you could chomp and then test length, or else test for not matching non-whitespace: $line !~ /\S/. Each suggestion accomodates a little different notion of which lines are considered blank.} else { print "This line intentionally left blank.\n"; }
You probably mean to print whole lines, rather than just what you captured ($1).
After Compline,
Zaxo
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Parsing Multiple Lines.
by /dev/trash (Curate) on May 24, 2004 at 01:48 UTC | |
by Happy-the-monk (Canon) on May 24, 2004 at 08:49 UTC | |
by /dev/trash (Curate) on May 24, 2004 at 17:36 UTC | |
by Happy-the-monk (Canon) on May 24, 2004 at 17:39 UTC | |
by /dev/trash (Curate) on May 24, 2004 at 19:00 UTC |
In Section
Seekers of Perl Wisdom