use strict; sub filegrep { ... } my @files = filegrep('Match this!');
My best is 56:
How many strokes can you shave?sub filegrep { # 1 2 3 4 5 #12345678901234567890123456789012345678901234567890123456 my@k;for(<*>){open F,$_;push@k,$_ if grep/$_[0]/,<F>};@k }
kelan
Yak it up with Fullscreen ChatterBox
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Golf: Files Containing a Pattern
by Aristotle (Chancellor) on Oct 18, 2002 at 22:51 UTC | |
by Pug (Monk) on Oct 18, 2002 at 22:55 UTC | |
by tadman (Prior) on Oct 19, 2002 at 08:50 UTC | |
by broquaint (Abbot) on Oct 19, 2002 at 18:23 UTC | |
by tadman (Prior) on Oct 19, 2002 at 18:45 UTC | |
|
Re: Golf: Files Containing a Pattern
by abell (Chaplain) on Oct 18, 2002 at 22:38 UTC | |
|
Re: Golf: Files Containing a Pattern
by Juerd (Abbot) on Oct 19, 2002 at 11:13 UTC | |
|
Re: Golf: Files Containing a Pattern
by BUU (Prior) on Oct 19, 2002 at 03:07 UTC | |
|
Re: Golf: Files Containing a Pattern
by Pug (Monk) on Oct 18, 2002 at 22:51 UTC | |
|
Re: Golf: Files Containing a Pattern
by kelan (Deacon) on Oct 19, 2002 at 14:25 UTC | |
by Aristotle (Chancellor) on Oct 19, 2002 at 14:48 UTC |