CGI Perl Question:

Download Job Interview Questions and Answers PDF

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'.

Download CGI Perl Interview Questions And Answers PDF

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