http://www.perlmonks.org?node_id=897866

dbs has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, I am opening a few files like this:
use FileHandle; usr Fcntl; my $RLOG = new FileHandle "+>> $runlog"; my $MLOG = new FileHandle "+>> $mksysblog"; flock($RLOG, O_NONBLOCK) || warn "no NB lock $!"; flock($MLOG, O_NONBLOCK) || warn "no NB lock $!";
But I keep getting this error:  error: can not lock open: (1) my code giving this error is:
if ( scalar @_ == 1 ) { my $roll1 = @_; my $rollog1 = new Logfile::Rotate( File => $roll1, Count => 15, Dir => $dir, Gzip => $gzip, Flock => 'yes', Persist => 'yes' ); $rollog1->rotate(); }
plz help! thx!