Monky Python has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl -w use Device::SerialPort; use strict; $|=1; my %ergoCommands; ## initialize serial port my $portname="/dev/ttyS0"; my $port = new Device::SerialPort ($portname); $port->user_msg("ON"); $port->databits(8); $port->baudrate(4800); $port->parity("none"); $port->stopbits(1); $port->handshake("xoff"); $port->write_settings() || undef $port; my $count_out = $port->write("\x40\x0"); warn "command failed:$_[0]\n" unless ($count_out eq length($cmddata)); ## I don't want to go asleep :( ##sleep(1); ## hmm.. does not block ($real_in, $data_in) = $port->read(17);
MP
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: read does not block
by tachyon (Chancellor) on Sep 01, 2001 at 17:54 UTC |