in reply to Finding files excluding some
This is only slightly tested but I think it's right-
use File::Find::Rule; my @files = File::Find::Rule->file() ->not( File::Find::Rule->new->name("*.[!ao]") ) ->in("."); print join("\n", @files), "\n";
File::Find::Rule. Much easier interface than File::Find (update: fixed backwards names).
(update: thanks to afoken below; ("*.[!ao]") should not have the bang: ("*.[ao]"), and merlyn's example is probably more in line with what you're after.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Finding files excluding some
by afoken (Chancellor) on Mar 30, 2009 at 23:21 UTC |