Hello,

Recently I ran into a bug with File::MMagic where it returns
inconsistent results under mod_perl.

I'm interested in getting this bug fixed, or using an alternative module
that works.

What's interesting is that the same version of File::MMagic works
correctly on a different machine. I suspect that some other module
loaded has changed a global variable that File::MMagic depends on.

Someone has a bug report and patch to that effect here:
http://rt.cpan.org/Public/Bug/Display.html?id=11121

I recall having tried the patch there and didn't work for me. Maybe I
missed something. ( I didn't take good notes during that experiment... )

A README for it also states "Built-in magic entry does not work
correctly under mod_perl" Using an explicit magic file is recommended
instead. Can anyone spot the specific modperl  bug? I couldn't.

File::MMagic is used by Data::FormValidator's "file_format" constraint
for file uploads, so some other people may be using indirectly under
mod_perl as well.

Also, there are now some competing modules published, in part just to
work around this bug. I'm interested in anyone is using these
successfully under modperl and recommends them. One that seemed a bit
promising is File::Type:

http://search.cpan.org/dist/File-Type/lib/File/Type.pm

Adam Kennedy objected that this design used excessive system resources:
http://cpanratings.perl.org/dist/File-Type

Personally, I like the idea of fixing the mod_perl bug in File::MMagic
if we can.

Could it simply be a matter of fixing the use of the DATA handle, as
Stats suggest here?

http://mail-archives.apache.org/mod_mbox/perl-modperl/200403.mbox/[EMAIL 
PROTECTED]


     Mark

Reply via email to