Looking in the File::MMagic source, I see this (edited for
relevance):
use vars qw( $dataLoc );
sub new{
$dataLoc = $fh->tell() if (! defined $dataLoc);
}
Question: since $dataLoc is a package-scope variable and
will only be initialized once, would this cause problems
when forked?
I wrote some quick and dirty sample code which does, indeed
go wrong if I use File::MMagic. I assume
Anonymous Monk is using use. If I
require File::MMagic after the
fork, it seems to work fine.
So, question to Monks-more-experienced-than-I: What
happens to package variables when you fork?
Russ
Brainbench 'Most Valuable Professional' for Perl |