Apr 152010
How to find out whether reference is pointing to a scalar, array or hash in Perl?
Answer:
Use the ref() function
my $data = [1,2,3];
print ref($data); # print out ARRAY
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to find out whether reference is pointing to a scalar, array or hash in Perl?
Answer:
Use the ref() function
my $data = [1,2,3];
print ref($data); # print out ARRAY