in reply to Re: multiple dir. grep
in thread multiple dir. grep
please don't laugh..it took me a LONG time to get that to work. As you can see to make it all go a bit faster i have limited the list to only filenames that start with either 158 or 159. What I need to do is somehow get the contents of the other dir into this list whilst still keeping the newest filenames at the top. ps I'm not asking for a complete script just a few pointers as to how to go about doing it.opendir THEDIR, "$dirpath" || die "cant open $dirpath !"; @allfiles = grep /^(?:158|159)/,readdir THEDIR; closedir THEDIR; foreach $file (sort { ($b) cmp ($a) } @allfiles) { print "$file\n";}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: multiple dir. grep
by tlm (Prior) on Apr 06, 2005 at 14:07 UTC |