You can create indirect filehandles in a number of ways, some outlined in
perlfaq7, including using typeglobs and the various IO:: modules. However, checking whether a variable is a filehandle or not is not trivial; you can't use UNIVERSAL::isa since not all the types of indirects come from a common class. Instead, the following code does this check, without moving around in the file if needed.
Update,
seek doesn't do it as
chipmunk points out, but it does appear that
fileno works; normal filehandles, IO:: based ones, pipes as filehandles, all have no problem reporting a fileno. Scalars and references to anything else will trigger an error. Note that this only tells you if what you've got is a filehandle, nothing about the properties (readable, writable, etc).