open DisplayIO, "+> /dev/cuaa1" # open serial (display) device or die ("Can't open tty: $!") ; sub main () { #code to loop &scrollTest several times with a sleep of 1 sec... } sub process_keyboard_input () { syswrite DisplayIO, $KeyBoardInput ; # write to display } # process_keyboard_input sub scrollTest { syswrite DisplayIO, sprintf ("%c%c", 0xfe, 0x51); $KeyBoardInput = sprintf ("%cE%cX%s", 0xfe,0xfe,'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH'); process_keyboard_input (); sleep(1); } ..