in reply to blank lines up to a point
This may be the code you are looking for, uses the .. flip-flop operator which is true when the first condition is satisfied then remains true until the itteration after the second condition is true. With the second condition here never going to be true it flips but dont flop !
#!/usr/local/bin/perl -w use strict; while (<DATA>) {&logit ($_)} sub logit { my $line = shift @_; $line =~ s/\0//g; return unless (/\S/..0); print $line } __DATA__ Some data Some more Some later data
Cheers,
R.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: blank lines up to a point
by ysth (Canon) on Sep 15, 2004 at 10:51 UTC | |
by Random_Walk (Prior) on Sep 15, 2004 at 11:09 UTC | |
by periapt (Hermit) on Sep 15, 2004 at 13:59 UTC | |
by ysth (Canon) on Sep 15, 2004 at 15:00 UTC | |
by SpanishInquisition (Pilgrim) on Sep 15, 2004 at 19:04 UTC | |
|
Re^2: blank lines up to a point
by radiantmatrix (Parson) on Sep 15, 2004 at 19:41 UTC | |
by Random_Walk (Prior) on Sep 16, 2004 at 09:13 UTC | |
|
Re^2: blank lines up to a point
by Anonymous Monk on Sep 15, 2004 at 12:28 UTC |