in reply to getting files from Dir
opendir DH, "/directory"; @files = readdir DH; closedir DH; foreach (@files) { /tim(\d*)/; $num = $1; if ( ($num > 14 ) && ( $num < 51) {push @wanted, $_}; }
Code is untested, take your chances. ObBrag: I can make it smaller, but that's harder to read.
Update: Changes made as suggested by davis - thanks. Personally I think open and opendir should be unified, but I guess there's some good reason why not.
____________________
Jeremy
I didn't believe in evil until I dated it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: getting files from Dir
by davis (Vicar) on Jan 24, 2003 at 10:01 UTC | |
|
Re^2: getting files from Dir
by Aristotle (Chancellor) on Jan 24, 2003 at 16:55 UTC |