|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Recognizing Type of Reference
Is there a way to tell what type of reference a variable has... ie:
$mystring = \%MYHASH How can I tell that $mystring is a hash ref, instead of a normal variable, an anonyomous sub, or an anonyomous array? |
|
#2
|
|||
|
|||
|
$mystring = \%MYHASH;
use the ref keyword ref $mystring will return 'HASH' Other possible ref types are SCALAR, ARRAY, HASH and CODE (there are others) |
|
#3
|
|||
|
|||
|
Ahh, thanks
I remember reading about that a while ago, I guess I just forgot... heh
Thanks ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Recognizing Type of Reference |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|