typeglob |
]$ ./ref.pl
$n is a reference.
$t is a reference.
h is a reference.
$s is a reference.
$pp is a reference.
$globp is a reference.
$junk is not a reference.
--------------------------------
$n is a reference to a SCALAR.
$t is a reference to an ARRAY.
$h is a reference to a HASH.
$s is a reference to a CODE.
$pp is a reference to a REF.
$globp is a reference to a GLOB.
$ ./object.pl
The bless function tags the hash with its package name.
The value of $ref is: House=HASH(0x8737830).
The ref function returns the class (package) name:House.
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |