userlog.pl shit

The Perl script I wrote to do fun things for my MUCK has been nothing but trouble and depression the past two days. I'm half tempted to scrap the whole thing and write a replacement in Python.

For some reason it ends up invoking many copies of itself, and circumventing the script's use of pidof to make sure it doesn't run again if it's already running. It does:

# Are we supposed to run at all?
my $pidof = `pidof -x -o \%PPID $0`;
chomp $pidof;
if($pidof) {
    print "Hey, already running: $pidof\n";
    exit;
};

but it's not heeding it. I thought it might be related to a particular routine's use of die, but even with that routine turned off, it happened again last night. This is a very bad thing, since it uses up all the server's filehandles.

I really have no idea what to do, hence my entertaining the notion of scrapping and rewriting. Now I'm looking for any particular reason why pidof won't work with Perl scripts (even with -x, the script option). A trivial test script of the above pidof code sure works, and the script has worked for a few months now without exploding like it's now doing, so I don't really think it's this code's fault.