in reply to Testing for read() failures on different platforms

You could use the EFOO constants from the POSIX module and check against $! in a numeric context.

use POSIX qw( :errno_h ); ## Something that fails here if( $! == EISDIR ) { warn "error was directory\n" }