one common way of doing this sort of stuff is to have your script write
a PID (process ID) file. when you start up your process, your script
will check for this file, if the file is there, a copy of it is already
running. if the file is missing, your script will create the PID file
and continue
open files are attributes of a process. after you fork, you have 2
processes, files locks, open handles, as well as pending signals and
such are not shared. ie, when you print to STDOUT in child, it's not the
same STDOUT you expect in parent. why not use a pipe?
#!/usr/bin/perl
use strict;
use