From: epg <> Date: Sun, 13 Oct 2002 18:58:03 +0000 (+0000) Subject: Fix long-standing bug where filters were applied out of order because X-Git-Url: https://diplodocus.org/git/minc/commitdiff_plain/9106ab0547963029715327f3041dcb789537a83e?hp=10ca6d920a5130b26e70e9e1862299d7ef4ccc83 Fix long-standing bug where filters were applied out of order because hashes are not guaranteed to stay in the order they were defined. Use Tie::IxHash to make %FILTERS an ordered hash. README: Note that Tie::IxHash is now required. minc: use Tie::IxHash; (%FILTERS): Make this an ordered hash with Tie::IxHash. --- diff --git a/README b/README index b3b33db..db88751 100644 --- a/README +++ b/README @@ -3,6 +3,7 @@ $Id$ minc requires the following non-standard Perl modules and headers: Log::Dispatch +Tie::IxHash sysexits.ph Log::Dispatch is available on CPAN. You will almost certainly have to diff --git a/minc b/minc index 1f3570f..2cc604a 100755 --- a/minc +++ b/minc @@ -36,6 +36,7 @@ use Getopt::Std; use Log::Dispatch; use Log::Dispatch::File; use POSIX qw(strftime WEXITSTATUS WIFEXITED); +use Tie::IxHash; =head1 OPTIONS @@ -162,6 +163,7 @@ Where minc logs what it would do; used in -n mode. =cut our %FILTERS; +tie(%FILTERS, 'Tie::IxHash'); require "$HOME/.mincfilter"; if (-f "$HOME/.mincspam") {