0

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.

Community
  • 1
  • 1
Jakub Narębski
  • 309,089
  • 65
  • 217
  • 230

0 Answers0