in reply to multiple dir. grep
? That's a little quick and dirty, since I don't closedir at all, and I don't check the return value of opendir. But it is kind of slick.@files = sort grep -f, map {opendir DIR, $_; readdir DIR} @dirlist;
If perl had an operator (call it <,) that would execute both sides (left-to-right) and return the left side, then I could neatly do the map as
I think that would come in handy reasonably often.map { opendir DIR, $_; readdir DIR <, closedir DIR }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: multiple dir. grep
by BrowserUk (Patriarch) on Apr 06, 2005 at 15:02 UTC | |
|
Re^2: multiple dir. grep
by tlm (Prior) on Apr 06, 2005 at 14:16 UTC |