The documentation for ref() mentions several possible return values. I understand most of them, but not REF
, IO
, and LVALUE
. How would I write Perl code to cause ref
to return those values?
After reading the documentation on typeglobs and file handles, I came close for IO
with this code:
open(INPUT, '<', 'foo.pl');
print ref(*INPUT{IO}), "\n"; # Prints IO::Handle
For REF
and LVALUE
I tried several bizarre constructions, but had no success.