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
Array in List form: Geeks For Geeks 1 1 0 0 9 6 Array in scalar form: 3 6
Concatenation of Arrays: Welcome To Geeks 1 1 0 0 9 6 Difference in number of elements: 3
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.