On Aug 13, Jeff 'japhy' Pinyan said:
> use IO::Select;
>
> my $s = IO::Select->new;
> $s->add(\*SMTP_HANDLE);
>
> # 0 = timeout (return immediately if nothing waiting)
> while (my ($pending) = $s->can_read(0)) {
Ok, a timeout of 0 seconds is a WEE bit small. Make it .1 or something a
little
On Aug 13, Jeremy Kister said:
>I'm stumped on how to read from a filehandle, where I don't know how many
>lines are waiting for me.
You probably want to use IO::Select.
>Is there a way to tell if i have data in <$sock> waiting for me, without
>actually reading from the file handle (which could
I'm stumped on how to read from a filehandle, where I don't know how many
lines are waiting for me.
Consider this:
mickey> telnet a.mx.example.com 25
Trying 10.0.0.1...
Connected to a.mx.example.com.
Escape character is '^]'.
220-a.mx.example.com ESMTP
220- EXAMPLE.COM does not authorize the use