# Ermöglicht ein globales Lock auf Perl-Prozesse package Lock; use strict; use warnings; use Fcntl qw(:flock); use IO::File; my $self = { file => '/home/lockfile', FH => undef, }; sub import{ my $class = shift; $self->{FH} = IO::File->new or die "Can't get a FileHandle"; $self->{FH}->open($self->{file}, O_CREAT|O_RDWR) or die "IO-Error: $!"; flock($self->{FH}, LOCK_EX) or warn 'Your system does not support flock()'; } 1; ########################################################################