-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Something I've written too many times is an algorithm for applying include/exclude rules to a list of items. So that nobody else would ever have to think about this, I wrote (at the suggestion of C) L. This module will let you apply a path-based include/exclude list on lists of paths. As an example, let's say you want to exclude everyone from C, and C, but allow everyone to access everything else: lang:Perl use Algorithm::IncludeExclude; my $ie = Algorithm::IncludeExclude->new; $ie->include(); # default include $ie->exclude('admin'); $ie->include('secret'); Pretty simple. To evaluate the rules, just do: $ie->evaluate('admin', 'foo.pl'); # exclude $ie->evaluate('secret', 'files'); # exclude $ie->evaluate(''); # include $ie->evaluate(qw/foo bar baz/); # include What if you want to add an overlapping rule, to allow C? Again, very easy: $ie->include('admin', 'create_account'); $ie->evaluate('admin', 'create_account'); # include And how about globally denying all files that end in C<.pl>? $ie->exclude(qr/[.]pl$/); $ie->evaluate(qw/foo bar baz.pl/); # exclude $ie->evaluate(qw/foo bar baz.pl1/); # include Hopefully this will make your life easier :) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQCVAwUBRdBIxNAZeFPdJeQvAQLAYwQAngb9SMNnvcKejmsoa0vWc+9bvo/QQzsa InAWNcPi7hvjfiX+X1/U6pRloF5jsAHfG71aj4sHGbptrbPWNClRiRFUtxyXfBVm M537hraHQ456n7/V7HdOasx7+mqMIRYYX1biZ3tKFTFa8/o9EhBBleGO5JowGVWt RWWonp82Z0w= =lOL+ -----END PGP SIGNATURE-----