Here you can easily and simply create most of them:
use 5.010; say 'SCALAR: ', ref \undef; say 'ARRAY: ', ref [1..5]; say 'HASH: ', ref { key => 'value' }; say 'CODE: ', ref sub {}; say 'REF: ', ref \\undef; say 'GLOB: ', ref \*_; say 'LVALUE: ', ref \substr "abc", 1, 2; say 'LVALUE: ', ref \vec 42, 1, 2; say 'FORMAT: ', ref *STDOUT{FORMAT};
REF is just a link to another link. LVALUE is a special case of a scalar that has an external influence if it is modified.
IO is the base type behind the handles, you can make it explicitly display with Acme :: Damn from CPAN . As Michael Carman pointed out in the comments, you really shouldn't be painless objects - don't use it in real code.
use Acme::Damn; say 'IO: ', ref damn *STDIN{IO};
The source for the ref function also has bits of code to display "BIND" and "UNKNOWN", but there should be no way to get them, not mess with the internal elements. Blead also has an interesting unblessed "REGEXP" (different from "Regexp" above); if someone knows how to make ref output which ...
Jb. Sep 09 '09 at 14:45 2009-09-09 14:45
source share