$port->mock ('write', sub {my $Mock=shift;my $arg=shift;$arg=~s/\r/\n/g;print "wrote $arg to the serial port\n";});