I have been trying to use the module Win32::SerialPort
in perl 5.10
(perhaps it has some issues with 5.14). I would have to issue commands to the serial port and get their output. I have figured out that write will do the earlier part for me. For the output part I have seen implementations like:
$port_obj->write("ATE"); #assuming we give the AT command Echo
$res = $port_obj->input;
If this gave the output of the command, why can't we have the more intuitive like the following(even though $res
will then return the no. of bits written) with $res
capturing the output of write.
$res = $port_obj->write("ATE");
Additionally, I have also seen some implementations of $port_obj->read()
but I am not sure what is the difference between read and the input methods.
Please help.