Search results for "module:Perl::Critic::Policy::BuiltinFunctions::ProhibitUniversalCan"

Perl::Critic::Policy::BuiltinFunctions::ProhibitUniversalCan - Write < eval { $foo-can($name) } >> instead of UNIVERSAL::can($foo, $name). River stage three • 133 direct dependents • 406 total dependents

print UNIVERSAL::can($obj, 'Foo::Bar') ? 'yes' : 'no'; #not ok print eval { $obj->can('Foo::Bar') } ? 'yes' : 'no'; #ok As of Perl 5.9.3, the use of UNIVERSAL::can as a function has been deprecated and the method form is preferred instead. Formerly, ...

PETDANCE/Perl-Critic-1.148 - 07 Jan 2023 21:26:26 UTC

Perl::Critic::Policy::BuiltinFunctions::ProhibitUniversalIsa - Write < eval { $foo-isa($pkg) } >> instead of UNIVERSAL::isa($foo, $pkg). River stage three • 133 direct dependents • 406 total dependents

print UNIVERSAL::isa($obj, 'Foo::Bar') ? 'yes' : 'no'; #not ok print eval { $obj->isa('Foo::Bar') } ? 'yes' : 'no'; #ok As of Perl 5.9.3, the use of "UNIVERSAL::isa" as a function has been deprecated and the method form is preferred instead. Formerly...

PETDANCE/Perl-Critic-1.148 - 07 Jan 2023 21:26:26 UTC
2 results (0.064 seconds)