Well, then why not using lexical filehandles? e.g
{ # Make sure file gets closed and unlocked when we're done. open(my $IN, '<', ...) or die("...: $!\n"); # Wait for people to stop writting: flock($IN, LOCK_SH) or die("...: $!\n"); while (my $line = <$IN>) { ... } # close ($IN); # not really needed => closed at end of block }
Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"
In reply to Re^3: flock and open
by strat
in thread flock and open
by jeanluca
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |