sub readable { my $fh = shift; (O_RDONLY | O_RDWR) & fcntl( $fh, F_GETFL, my $slush); } for (qw/ > < >> +< +> /) { open my $fh, $_, 'foo' or warn $! and next; print "$_\t", readable($fh)? 'readable.': 'not readable.', $/; } __END__ > not readable. < not readable. >> not readable. +< readable. +> readable.