in reply to Re: Thread to read a file every second
in thread Thread to read a file every second
EDIT TO PREVIOUS: I should have put in an end check parameter:
sub check_file { my ($fpath, $arrp) = @_; my $max = 15; my $handle; while (!-e $fpath || !open($handle, $fpath)) { return if (!$max--); sleep(1); } $$arrp = join('', <$handle>); close($handle); }
|
|---|