in reply to Testing $! when use strict is in effect

You can check condition "error EFOO is the case" via the %! magic hash:
if ($!{EWOULDBLOCK} ) { # would block };
Search for %ERRNO in perldoc perlvar.