#!/usr/bin/perl use strict; ## become a daemon exit if fork(); ## loop and look for a filename appearing my $fn="/homes/bob/important_file.txt"; while (1) { if (-f $fn) { ## a file was found, do something DoSomething(); ## then exit exit; } ## pause 5 minutes before checking again sleep 300; } ## never here! exit;
In reply to Re: perl daemon
by mr.nick
in thread perl daemon
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |