Re: A little text file munging golf on the list
[email protected] (Marius Ascheberg)
| Newsgroups | perl.golf |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 13 Mar 2003 11:50:23 +0200 (EET) Tuomo Salo <[email protected]> wrote: > #!perl -p0 > s#^(\S* )(.*)\n\1#$1$2 #m&&redo > > If the input contains no duplicate lines, the "\S*" can be replaced with ".*". > Using a literal newline would shave yet another stroke. #!perl -p0 s/^((\S+).+)\n\2/$1/m&&redo 30 strokes, but I was not able to remove the redo.