It is not clear why you need threads to do this, more detail might be in order. perlthrtut would be a good point to start for info on threads.
my $file = '/path/to/some/file'; while(1) { if ( -e $file ) { # read file # do stuff # unlink $file; # otherwise we will keep finding it } sleep 1; }
If you want to use simple code like this you will want to daemonize it. There is a example of daemonizing on my scratchpad
cheers
tachyon
In reply to Re: Thread to read a file every second
by tachyon
in thread Thread to read a file every second
by Nalina
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |