Re: Another one-liner?
Daniel Tiefnig <[email protected]> Wed, 24 Jun 2009 16:01:50 +0200
| Newsgroups | gmane.comp.lang.perl.golf |
|---|---|
| Message-ID | <[email protected]> |
Phil Carmody wrote:
> I needed to remove blank-line-separated chunks of code from a text
> file if those chunks contained any lines which were 'too long'.
[...]
> If you think how little it does, it's got to be one-linerable, no?
Here's one that does split on lines with whitespace too, but is much
less elegant than my first one:
perl -0777 -F'(?<=\n)\s*(?=\n)' -ane'/.{65535}/||print for@F'
Maybe one can save one or the other stroke with a smarter solution of
the newline issue...
lg,
daniel