in reply to Abort if instance already running?

Don't know if using a flag(better: lock)-file is the best way to do it, but it should work for your purpose. Something along...

BEGIN { our $LOCKFILE = "/tmp/frogs.pid"; die "Another process is already running (see content of $LOCKFILE for + pid)...\n" if -e $LOCKFILE; open my $out, '>', $LOCKFILE or die "cannot open $LOCKFILE - $!"; print $out "$$\n"; close $out; # chmod 0600 ... if you like } warn "running... with PID: $$ ...\n"; sleep 10; END { unlink $LOCKFILE or die "cannot remove lock-file $LOCKFILE - $!"; }
It is not race-condition proof, but 10-20 minutes in between runs is not a race condition, I guess.
Update: Ok, when using cronjobs, there is a probability not equal to zero that a cronjob may collide one day... interacting with a manual invocation.
Update2: Used /tmp instead of /var/run since you might not have the privileges (root) to access files there. If you do, /var/run is closer to best practises. You might also need to register SIGnal handlers to remove the lock file.