Is there any function available in Perl to check the reference type:
my $ref=\@array;
I need to get the reference type as array by the function.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use function ref:
The return value is the one of: SCALAR, ARRAY, HASH, CODE (reference to subprogram), GLOB (reference to typeglob) and REF (reference to reference).
Actually, ref function may return more values and in case of reference to object returns package name instead of type: http://perldoc.perl.org/functions/ref.html.