$packet_out = 4; On the serial wire: 0x34 (which is ASCII code for character 4) $packet_out = '4'; On the serial wire: 0x34 (which is ASCII code for character 4) $packet_out = 0x65; On the serial wire: 0x31 0x30 0x31 (which, bizarrely, is ASCII code for '101' which is a string of the decimal ASCII code for 'e' which has the ASCII code 0x65) #### unless (open ($SERIALPORT, "+<", $comport)) {die "Cannot open $comport: $!"} system("stty -cstopb hupcl ignbrk -iexten -echo -echoe -echok " . "-echoctl -echoke -crtscts -ignpar cs8 9600 time 5 -icrnl " . "-ixon -opost -isig -icanon -F $comport"); die unless binmode($SERIALPORT, ':raw:bytes'); #numerous variations tried