In some code I have to now maintain, I first turned on use strict and use warnings. Then the following warning came up:
Scalar value @_ better written as $_
the error corresponds to this line:
( $paramName, $paramValue ) = split /=/, @_, 2;
My thinking on this code is that @_ creates an array slice consisting of the first element of @_. This array slice is a list, but is forced into scalar context because it is the second argument of split. Forcing a list into scalar context returns its last argument, which is the only argument in this case. Thus we would've been better off writing $_
Sound good? I have to make this code change and justify it on this code which has had many years of comfortable use without use strict or use warnings. Any code change I make has to be rigorously justified, thus I want to 100% sure of what I am saying.