Rafael Garcia-Suarez <[EMAIL PROTECTED]> writes:

> Gisle Aas wrote:
> > Rafael Garcia-Suarez <[EMAIL PROTECTED]> writes:
> > 
> > > Change 24194 by [EMAIL PROTECTED] on 2005/04/07 12:42:07
> > > 
> > >   Mention that select() returns -1 on error,
> > >   as suggested by Hernan Perez Masci
> > 
> > Hmmm, returning a TRUE value on failure is quite unperlish.  I wonder
> > how much software got this wrong?  For instance among the core modules
> > we find code like this.
> 
> That's right, however returning 0 on non-error makes sense (see select(2))

I don't agree that this makes sense. The situation here is just the
same as it is for sysread().  The sysread function has always been
documented to return undef on failure.  The return value of select has
not been documented and it seems logical to assume it worked like
sysread.

> and there are backward compatibility issues (in the event that some
> code gets it right...)

Sure.  It is a bit late in the game to change this now, but it might
be that this actually breaks less programs than it fixes.  Would be
useful to do a CPAN survey to estimate how many occurrences got it
right and how many got it wrong I don't think I have the tuits for
this survey myself right now (too many false grep positives because of
the other select builtin we have).

--Gisle

Reply via email to