in reply to Starting a script according to processes

Perhaps it would be useful to just check the time the executable was last run. It would certainly save a lot of polling the process table. The idea is to check access time on the file. To be extra careful, also check that it doesn't match mtime. That would indicate that the file had been changed, not run. That still errs if the file has been read instead of run.

use Time::Local; my $exe = '/usr/bin/foo'; my ($atime, $mtime) = (stat $exe)[8,9]; print $exe, " just ran.\n" if timelocal(localtime) - $atime < 10 and $mtime < $atime;

After Compline,
Zaxo