Perl Home
PERL Functions
© 2011 TutorialsPoint.COM
|
PERL ref Function
Syntax
Definition and Usage
Returns a true value if EXPR, or $_ if EXPR is not supplied, is a reference. The actual value returned also defines the type of entity the reference refers to.
The built-in types are:
REF
SCALAR
ARRAY
HASH
CODE
GLOB
LVALUE
IO::Handle
If a variable was blessed with the bless() function, then the new data type will be returned. The new data type will normally be a class name.
Return Value
Example
Try out following example:
#!/usr/bin/perl -w
$foobar = { };
bless($foobar, 'ATMPCLASS');
print "ref() \$foobar is now in class ", ref($foobar), "\n";
|
It will produce following results:
ref() $foobar is now in class ATMPCLASS
| |
|

|
|
|