in reply to starting a script when a file appears in a directory

Two primary methods immediately come to mind: Assuming you have a scheduling means, I would say the second is the better method -- something isn't always running (your efficiency concern), and it's more robust becuase you don't have to worry about the job getting hung or killed.

Two methods pop to mind for the actual "checking" part, too:
Be sure to reference the File::Find module as well as the -X and stat sections in the perlfunc manpage.

Update: Here's an actual one-liner solution i used out of a linux crontab once (convenient cause cron takes care of emailing you iff there's output)--this is the shell script wrapping it (I don't necessarily recommend this, but might have some reference value):
# USAGE: touchedCheck filename [minutes] # # Exit Value: 0 if file was touched; 1 if not touched. # # Will print info about the file iff it changed in the last N minutes. # Otherwise prints nothing. # # Intended for crontab use, such as: # 0 * * * * touchedCheck /tmp/some_file.txt 60 # /usr/bin/perl -e '$f=shift;$N=shift||60; printf("%s was changed %d min +utes ago.\n%s", $f, $x/60.0, `/bin/ls -lart $f`) && exit(0) if ($x = +(time - (stat($f))[9])) <= 60*$N; exit(1)' $1 $2