Listing 5.
all_together.pl
Home Automation: The X10 Nitty-Gritty
The Perl Journal, Spring 2000
 
#!/usr/bin/perl -w
# FILE: all_together.pl
# USAGE: perl all_together.pl [ PORT ]
# same PORT defaults as cm17_bit_toggle.pl

require 'start_port.pl';  # initialization for real ports

use ControlX10::CM17;
use strict;

my $serial_object = open_port (@ARGV);

print "address A All Lamps ON\n";
send_cm17($serial_object, 'AO');
print "address A All OFF\n";
send_cm17($serial_object, 'AP');

$serial_object->close || die "\nclose problem with port\n";