Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ffcccc
langperl
use UNIVERSAL qw(can);  # deprecated

# ...

sub doit {
  my ($func) = @_;

  if (can($self, $func)) {
    $self->$func();
  }
  # ...
}

While Although this code works correctly now, the use statement will one day not be accepted by the Perl interpreter.

...

Tool

 Version

Checker

 Description

Perl::Critic

5.0 

Modules::ProhibitEvilModules
BuiltinFunctions::ProhibitUniversalCan
BuiltinFunctions::ProhibitUniversalIsa

 Implemented

B::Lint

 5.0

 ... is deprecated and will be removed in a future ...

 

Bibliography


 

...