Rocco Caputo wrote:
On Sun, Jul 11, 2004 at 10:09:38PM +0200, James Mastros wrote:

All unreachable code is either people misusing the term "unreachable", a bug in Devel::Cover, or dead code that should be removed.

Here's a puzzle, then.

I just ran into a similar "problem" in POE::Driver::SysRW.  For
portability I have a couple lines similar to

    $! = 0 if $! == EAGAIN or $! == EWOULDBLOCK;

EAGAIN and EWOULDBLOCK are identical on most systems.  In fact, one is
usually defined in terms of the other.  They differ on a few platforms,
however, and it's important to check both.
Redefine EAGAIN and EWOULDBLOCK (they're just perl constants), and rerun that code, after setting $!. (Your code probably isn't written so that is in one callable place, but it could be.)

This is probably a good example of where it's too silly to force it to test all the possibilities, but it is possible.

You could also consider it a bug in perl's optimizer, which should notice that $a||$a == $a. (But you'd be wrong, as this isn't neccessarly true if $a is magical, and $! is, in fact, magical.)

-=- James Mastros

Reply via email to