How to make the following assignment, as arrayreference
assignment ?

my $arr_ref='[1,2,3,4,4,'elem']';

Answers were Sorted based on User's Feedback



How to make the following assignment, as arrayreference assignment ? my $arr_ref='[1,2,3,4,..

Answer / kiruthikau

Refer this program.
[code]
my $ref=[1,2,3,4];
print ref $ref;
[/code]

Is This Answer Correct ?    0 Yes 0 No

How to make the following assignment, as arrayreference assignment ? my $arr_ref='[1,2,3,4,..

Answer / kiruthikau

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

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

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More CGI Perl Interview Questions

Why to use perl?

1 Answers  


my @array=('data1','data2'); my @array1=('data1','data2'); my ($i,$k); $i=7; $k=7; while($i){ $array [++$#array] = 'ree'; $i--; print "@array"; } while($k){ push(@array1,'ree'); $k--; print "@array1"; } Are these two while loop are doing the same functionality ? What may be the difference?

1 Answers   A1 Technology,


What are scalars?

1 Answers  


What are stdin, stdout and stderr?

1 Answers  


How do you find the length of an array?

1 Answers  


Comment on array slicing and range operator

1 Answers  


What purpose does each of the following serve: -w, strict, - T ?

2 Answers  


How many data types are there in perl?

1 Answers  


What are prefix dereferencer? List them.

1 Answers  


What is hash?

1 Answers  


write a Perl script to find a particular word in a paragraph???

1 Answers  


What is 'commit' command in perl?

1 Answers  


Categories