Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: wordsmithing

Despite being over 15 years old, Perl 5 continues to grow. Much of this growth comes from Perl's practice of assimilating popular CPAN modules that prove to be popularinto the core language. Modules that are not part of the core Perl language must be explicitly included to be used by a program, but modules that are part of the core language need not be.

When a module has been assimilated into the core language, the original module is still available in CPAN, but its use is deprecated. Do not import deprecated modules. It is perfectly valid to use their features without importing them, as they are now integrated into the core language.

...

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

Compliant Solution

This compliant solution uses Universal::can() without explicitly importing it.

...