The driver code: guided tour
Part 1: the "use" statements and some setup
use strict;
use warnings;
use Net::Ping;
use WWW::Mechanize;
use Device::ParallelPort;
use vars qw/$port $mech $pinger/;
$port = Device::ParallelPort->new;
# tidy up and quit if we get an INT
$SIG{'INT'} = sub {
$port->set_bit( $_, 0 ) for ( 1..7 );
exit;
};