Subject: | new policy suggestion- prohibit unspecified context for called subroutines in lists |
The proposed policy would prohibit examples like this:
my %hash = (key1 => some_function(), key2 => 3);
where some_function is defined as:
sub some_function { return }
Since some_function() is called in list context in the definition of
%hash, this results in an odd number of arguments to the hash constructor.
this is almost always unintentional.
As it is good practice to not explicitly return undef, it should be good
practice to explicitly define the context of the called function when it
is called in a list.