package Highlander; use strict; use warnings; use Carp qw( croak ); use Fcntl qw( :flock ); # LOCK_EX LOCK_NB sub import { croak( "The Highlander does not appreciate being 'use'd.", " Please simply 'require' the Highlander.\n" ); } if( ! defined fileno *main::DATA ) { croak( "No __END__ in sight. Please put an __END__", " to $0 (or 'require' the Highlander; don't 'use')\n" ); } flock( *main::DATA, LOCK_EX|LOCK_NB ) or die( "The Highlander feels the quickening.", " Another $0 is already here.\n" ); "There can be only one!";