Subject: | Breaks under forked environments |
The __DATA__ section can only be read once. Under a forked environment such as mod_perl this will prevent the module from ever working correctly.
The following patch resets the DATA filehandle position after reading the data.
--- Types.pm Thu May 1 16:46:07 2003
+++ Types.pm Fri May 9 18:47:27 2003
@@ -20,6 +20,7 @@
{ local $_;
local $/ = "\n";
+ my $pos = tell(MIME::Types::DATA);
while(<MIME::Types::DATA>)
{ s/\#.*//;
next if m/^$/;
@@ -46,6 +47,7 @@
, system => $os
);
}
+ seek(MIME::Types::DATA,$pos,0);
}
close DATA;