]> diplodocus.org Git - minc/commitdiff
Fix long-standing bug where filters were applied out of order because
authorepg <>
Sun, 13 Oct 2002 18:58:03 +0000 (18:58 +0000)
committerepg <>
Sun, 13 Oct 2002 18:58:03 +0000 (18:58 +0000)
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.

README
minc

diff --git a/README b/README
index b3b33db..db88751 100644 (file)
--- 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 (executable)
--- 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") {