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 |
Is perl a case sensitive language?
what is the main function of fork() in cgi programming?
When would you not use Perl for a project?
What is cpan in perl?
Why do you use Perl?
Perl uses single or double quotes to surround a zero or more characters. Are the single(' ') or double quotes (" ") identical?
Explain perl one-liner?
What does 'do' statement do in perl?
what are the three groups involved in information sharing?
Explain lists in perl?
You want to connect to sql server through perl. How would you do that?
What are scalar data and scalar variables?