Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

RE: Flock Subroutine

by merlyn (Sage)
on Jul 28, 2000 at 07:24 UTC ( [id://24797]=note: print w/replies, xml ) Need Help??


in reply to Flock Subroutine

Thus spoke the mt2k:
Using a simple flock FILEHANDLE, LOCK_EX; won't always succeed in locking a file.
Hmm. I don't know of a time that wouldn't either succeed or fail. Maybe you're thinking of or'ing it with LOCK_NB, in which case your code makes sense. But not as it is.

And next, what the heck is this?

sleep .15;
That's a sleep 0, since sleep() doesn't take a fractional number unless you've called in the right overloading module.

Great idea. Bad code. (And I'll probably get flamed for this post again. So be it.)

-- Randal L. Schwartz, Perl hacker

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://24797]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-06-18 01:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.