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 • 131 direct dependents • 386 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.142 - 29 Nov 2022 02:20:23 UTC

Perl::Critic::Policy::BuiltinFunctions::ProhibitUniversalIsa - Write < eval { $foo-isa($pkg) } >> instead of UNIVERSAL::isa($foo, $pkg). River stage three • 131 direct dependents • 386 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.142 - 29 Nov 2022 02:20:23 UTC
2 results (0.119 seconds)