CGI Perl Question:

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

Tweet Share WhatsApp

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 PDF Read All 18 CGI Perl Questions
Previous QuestionNext Question
What is caller function in perl?Difference between Perl and Mod_perl?