#!perl.exe -wT use Strict; use CGI; my $q = new CGI; print $q->header("text/html"); print < Help ME

Just a simple page for now

WEB_PAGE my ($device, $port, $house, $unit, $interface); # Use BEGIN so we can conditionally eval modules BEGIN { # Set the parameters $interface = 'CM11'; $port = 'COM1'; $house = 'A'; $unit = '2'; use Win32::SerialPort 0.17; die "$@\n" if ($@); $device = Win32::SerialPort->new ($port) or die "Can't start $port\n"; eval "use ControlX10::CM11 qw( :FUNC 2.06 )"; die "$@\n" if ($@); } $BASE_URL = '/cgi-bin/lights.cgi'; print "Turn light ON"; # &toggle_on; # &toggle_off; sub toggle_on{ my $cmd = 'J'; print"

Turning Lights ON

"; print "---> Toggle light $house$unit to on \($cmd\)\n"; send_cm11($device, $house . $unit); send_cm11($device, $house . $cmd); } sub toggle_off{ my $cmd = 'K'; print"

Turning Lights OFF

"; print "---> Toggle light $house$unit to on \($cmd\)\n"; send_cm11($device, $house . $unit); send_cm11($device, $house . $cmd); }