Possible Duplicate:
How can I test if I can write to a filehandle?
Now that I found how to check in Perl if given scalar variable holds a filehandle, is it possible to check if the filehandle was opened for reading, or was opened for writing? And if it is, then how to check it?
The -r and -w operators works, from what I understand, only on filehandles opened to real files, and not e.g. pipes, in-memory files (opening to scalar), etc.