I have a forking server. I load all modules before I fork.
...or do I? I want a message to be logged to STDERR for every module loaded after a certain point in my program.
I was going to use the following, but it's logging some scripts executed using do
.
my %ignore = map { $_ => 1 } ( ... );
unshift @INC, sub {
my (undef, $path) = @_;
warn("$path wasn't loaded before forking.\n")
if !$ignore{$path};
return ();
};
I'm not out of ideas, but before I spend more time on this, I was wondering if there's an existing solution.