"…a more elegant solution?"
You could take a look at your process table:
use strict; use warnings; use Proc::ProcessTable; my $processes = Proc::ProcessTable->new; for ( @{ $processes->table } ) { …; }
$_->pid and $_->cmndline might be what you want. See also
«The Crux of the Biscuit is the Apostrophe»
In reply to Re: Mechanism for ensuring only one instance of a Perl script can only run?
by karlgoethebier
in thread Mechanism for ensuring only one instance of a Perl script can only run?
by redapplesonly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |