in reply to Distinguishing a filehandle for an in-memory string
What you want to know is whether it's a system file handle or not. You can use fileno for that. It returns -1 for file handles that aren't system file handles (such as the in-memory string handles).
In Section
Seekers of Perl Wisdom