I'm trying to extend this to a comparable readable() function.
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.
Huh??!
My criteria for good software:
- Does it work?
- Can someone else come in, make a change, and be reasonably certain no bugs were introduced?