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


in reply to RFC: A new module to help avoid running multiple instances of the same script (via cron, for example)

I think Cron:: is a bad top level namespace when the module is not specific to cron at all.

What about using Process:: instead? Something like Process::AvoidConcurrentRuns or Process::AvoidMultipleInstances or Process::Singleton

Also if you put this on CPAN, you might think about different possible use cases:

The interfaces for that might look like this:
# first case: use Process::Singleton qw(:auto_verbose); # second case: use Process::Singleton qw(:auto); # third case: use Process::Singleton qw(is_running); if (is_running()) { ... } else { ... }

This is of course just an example, but I want to encourage you to think more about the interface.

  • Comment on Re: RFC: A new module to help avoid running multiple instances of the same script (via cron, for example)
  • Select or Download Code