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
Answer / kiruthikau
Refer this program.
[code]
my $ref=[1,2,3,4];
print ref $ref;
[/code]
Is This Answer Correct ? | 0 Yes | 0 No |
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 |
What exactly is grooving and shortening of the array?
Consider the following example #! /bin/perl use strict; sub sample { my @arr=(1,2,3,4); return @arr; } my ($a,$b,$c,$d) = &sample; print "$a\n$b\n$c\n$d\n"; In the above code, How can I get the $c without using the arguments such as $a,$b. I don't want to use any array to get the return values.
How does polymorphism work in perl?
What are the different instances used in cgi overhead?
What are numeric operators in perl?
What happens when you return a reference to a private variable?
How to read a single line from a file in perl?
How to concatenate strings in perl?
Define print() function in perl?
What does init 5 and init 0 do?
What is the purpose of “_file_ literal” and “_line_ literal” in perl?
Why to use perl scripting?