Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Easiest way to protect process from duplication.

by gnosti (Chaplain)
on Jan 23, 2012 at 05:52 UTC ( [id://949311]=note: print w/replies, xml ) Need Help??


in reply to Re: Easiest way to protect process from duplication.
in thread [Solved]Easiest way to protect process from duplication.

Here's a variation that uses the __DATA__ handle.
use Fcntl qw(LOCK_EX LOCK_NB); die "Another instance is already running" unless flock DATA, LOCK_EX|L +OCK_NB;

Replies are listed 'Best First'.
Re^3: Easiest way to protect process from duplication.
by JavaFan (Canon) on Jan 23, 2012 at 07:47 UTC
    That actually requires a __DATA__ (or __END__) token to be present.
      Thank you too. BTW __END__,__DATA__,etc is there any general name for these tokens, (like "Labeled blocks", "builtins",...)? I'm newbie in perl so I just wanted to read about this stuff.
Re^3: Easiest way to protect process from duplication.
by kazak (Beadle) on Jan 24, 2012 at 13:29 UTC
    Thank you for your post, that is what I really need.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2024-04-23 12:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found