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