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 |
What does 'do' statement do in perl?
“Perl regular expressions match the longest string possible”. What is the name of this match?
Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?
What is the different between array and hash in perl programming?
How do I replace every TAB character in a file with a comma?
what is the procedure to define a user define module in your perl application?
Explain what is STDIN, STDOUT and STDERR?
how to connect cisco switch uisng perl script
What are the various advantages and disadvantages of perl?
How to do comment in perl?
What are the advantages and disadvantages of perl language?
How will you open a file in a write-only mode in perl?