$port->mock ('write', sub {my $Mock=shift;my $arg=shift;$arg=~s/\r/\n/g;print "wrote $arg to the serial port\n";}); #### wrote ATE0 to the serial port wrote AT+CMGF=1 to the serial port wrote AT+CPIN=9532 to the serial port wrote ATI to the serial port