![]() |
VOOZH | about |
scalar keyword in Perl is used to convert the expression to scalar context. This is a forceful evaluation of expression to scalar context even if it works well in list context.
Syntax: scalar expr
Returns: a scalar value
Example 1:
Array in List form: Geeks For Geeks 1 1 0 0 9 6 Array in scalar form: 3 6
Example 2:
Concatenation of Arrays: Welcome To Geeks 1 1 0 0 9 6 Difference in number of elements: 3