* Rob Janes <janes....@gmail.com> [2009-11-28 11:45]:
> The fix is a hack to Net::Cmd,
>
> my $select_ret = UNIVERSAL::can($cmd, 'pending') && $cmd->pending ? 1
> : select($rout = $rin, undef, undef, $timeout);

Please do not write `UNIVERSAL::can($foo, $some_method)` for any
other value of $some_method than `can`. It breaks polymorphism.
Write `$foo->can($some_method)` instead. (And if the value is
`can`, you probably want `Scalar::Util::blessed` instead.)

> Seems to me the IO::xxx api needs to handle this, but I'm not
> sure who to put this to. Any ideas what to do with this? Is
> there a better way to do this?

Seems to me that it is the job of IO::Foo classes to respond to
a `select` as being ready to read from, if they have buffered
data, even if the underlying handle is not.

I don’t know if that response is overridable in Perl classes.

If it’s not, then a `pending` as in IO::Socket::SSL would have to
be adopted ecosystem-wide.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

Reply via email to