#!perl use strict; my @io = (1,0,0,0,0,0,0,0); # all off switch(3,1); # left light on switch(3,0); # left light off switch(4,1); # left bell on switch(4,0); # left bell off switch(3,1); # left light on switch(4,1); # left bell on switch(3,0); # left light off switch(4,0); # left bell off sub switch { $io[$_[0]] = $_[1]; my $num = oct('0b'.join '',@io); # bin to dec my $cmd = ''; print $cmd."\n"; #$port->write($cmd); #$port->lookclear(); }