Blinkenlites with Perl A case study in driving custom home-made hardware with Perl #11

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; 
};	 
Copyright © 2006 Steve McNabb