March 2002 | Perl Hardware Store | 20 |
use Fcntl ':flock';
if (something()) { open F, $FILE or die ...; flock F, LOCK_SH; print while <F>; } else { open F, "> $FILE" or die ...; flock F, LOCK_EX; my $data = qx{some command}; print F $data; }
continued...
Next | Copyright © 2002 M-J. Dominus |