in reply to Re^2: flock and open
in thread flock and open
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"
|
|---|