Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 50080
Status: new
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: justincase [...] yopmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: new policy suggestion- prohibit unspecified context for called subroutines in lists
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Type: text/plain
Charset: utf8
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 525
Download (untitled) / with headers
text/plain 525b
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.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.