The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Search results for "module:Perl::Critic::Policy::ClassHierarchies::ProhibitOneArgBless"

Perl::Critic::Policy::ClassHierarchies::ProhibitOneArgBless - Write bless {}, $class; instead of just bless {};. River stage three • 133 direct dependents • 408 total dependents

Always use the two-argument form of "bless" because it allows subclasses to inherit your constructor. sub new { my $class = shift; my $self = bless {}; # not ok my $self = bless {}, $class; # ok return $self; }...

PETDANCE/Perl-Critic-1.152 - 17 Oct 2023 04:09:08 UTC
1 result (0.066 seconds)