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 goto name?
What are the logical operators used for small scale operations?
How to copy a file in perl?
What does file test operators do in perl?
What elements of the Perl language could you use to structure your code to allow for maximum re-use and maximum readability?
There are two types of eval statements i.e. Eval expr and eval block. Explain them.
Which guidelines by Perl modules must be followed?
What are the advantages of perl programming?
What is qq (double q)operator in perl?
Write a script to reverse a string without using perl's built in functions?
What $! In perl?
What does read () command do?