What is the difference between $array[1] and @array[1]?
Answer / kiruthikau
$array[1] represents a scalar value.
@array[1] represents array slicing.
@array[1] returns a list with one scalar value.
We should use $ when we want a scalar value.
If we want a list we need to use @.
If we use 'use warnings' then @array[1] will give the warnings
like ,Scalar value @array[1] better written as $array[1].
Is This Answer Correct ? | 3 Yes | 0 No |
Explain the difference between my and local?
Explain '->' in perl?
What does next statement do in perl?
What is perl I used for?
Explain which feature of PERL provides code reusability?
Comment on the scope of variables in perl.
How to compare two strings in perl?
What do the symbols $ @ and % mean when prefixing a variable?
What are the various uses of perl?
Explain chop?
Explain ivalue in perl?
You want to download the contents of a url with perl. How would you do that?