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 |
Which feature of Perl provides code reusability ? Give any example of that feature.
What is the usage of -i and 0s options?
Explain the difference between die and exit in perl?
How to read from a pipeline with Perl
Write a cgi program to show the header part?
Which guidelines by Perl modules must be followed?
Write syntax to use grep function?
What is the difference between use and require in perl programming?
How do you turn on the perl warnings?
Explain perl. When do you use perl for programming?
In Perl we can show the warnings using some options in order to reduce or avoid the errors. What are that options?
I have one question regarding to eval function. I know eval function is use for error checking but I am not able to understand below line. eval \'exec perl -S $0 ${1+\"$@\"}\' if 0; $0 for script name $@ set if error occur