=over =item ref EXPR X X =item ref Returns a non-empty string if EXPR is a reference, the empty string otherwise. If EXPR is not specified, C<$_> will be used. The value returned depends on the type of thing the reference is a reference to. Builtin types include: SCALAR ARRAY HASH CODE REF GLOB LVALUE FORMAT IO VSTRING Regexp You can think of C as a C operator. if (ref($r) eq "HASH") { print "r is a reference to a hash.\n"; } unless (ref($r)) { print "r is not a reference at all.\n"; } The return value C indicates a reference to an lvalue that is not a variable. You get this from taking the reference of function calls like C or C. C is returned if the reference points to a L. The result C indicates that the argument is a regular expression resulting from C. If the referenced object has been blessed into a package, then that package name is returned instead. But don't use that, as it's now considered "bad practice". For one reason, an object could be using a class called C or C, or even C. Also, C doesn't take into account subclasses, like C does. Instead, use C (in the L module) for boolean checks, C for specific class checks and C (also from L) for type checks. (See L for details and a C example.) See also L. =back