perlminator has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
i'm reading from the serial device this way:
$TTY = "/dev/ttyS0"; $STTY ="ignbrk -icrnl -ixon -opost -onlcr -isig -icanon -iexten parenb + -parodd cs8 -echo -echoe" ." -echok -echoctl -echoke min 0 time 5 1200"; `stty $STTY <$TTY`; open(IN,"$TTY") || die "\ncan not open Interface for reading $!\n"; open(OUT,">$TTY") || die "\ncan not open Interface for writeing $!\n"; $oldfh = select(OUT); $| = 1; select($oldfh); $| = 1;
it is working quiet well,
the only problem is, that when there is no data
on the Port, my code has a timout of about 0.5sec.

How can i change this timeout to 0 sec?

bye perlminator

Replies are listed 'Best First'.
Re: reading from serial device
by Zaxo (Archbishop) on Jun 15, 2004 at 07:22 UTC

    You may want to look at Device::SerialPort. It offers a more refined interface than talking to the raw device.

    After Compline,
    Zaxo

Re: reading from serial device
by calin (Deacon) on Jun 14, 2004 at 17:50 UTC

    Replace time 5 with time 0, I guess.

    This is just a guess. See stty(1) or go to a dedicated serial programming forum or mailing list.

      Thanx calin
      that was a big help
      is working now

      bye