CGI Perl Question:

How to make the following assignment, as arrayreference assignment?
my $arr_ref=[1,2,3,4,4,elem];

CGI Perl Interview Question
CGI Perl Interview Question

Answer:

my $ref=[1,2,3,4];
print ref $ref;

ref will return the type of reference.
In this case ref will return as 'ARRAY'.


Previous QuestionNext Question
What is caller function in perl?Difference between Perl and Mod_perl?