Versions Compared

Key

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

...

Here is a list of deprecated functions along with their recommended alternatives if available:

Deprecated

Preferred

die()

Carp::croak()

warn()

Carp::carp()

-t

IO::Interactive

format()

Template, Perl6::Form

The following modules are also deprecated:

Deprecated

Preferred

base

parent

Noncompliant Code Example (die())

...

EXP30:EX1: There are several instances when die() and warn() are preferred over carp() and croak():

  • Inside a signal handler . This is because the behavior of croak() and carp() functions when invoked inside a signal handler are not documented.
  • Outside a subroutine, that is, when used in a small Perl script. In this case, all four functions have no stack trace to indicate their calling location.

...

Using deprecated or obsolete classes or methods in program code can lead to erroneous behavior.

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

EXP30-PL

info

Medium

probable

Probable

low

Low

P12

L1

Automated Detection

Tool

Diagnostic

Perl::Critic



ErrorHandling::RequireCarping

 

InputOutput::ProhibitInteractiveTest

 

Miscellanea::ProhibitFormats

Security Reviewer - Static Reviewer

PERL_S37

Related Guidelines

...

...

...

...

...

Bibliography

...

...

Chris Dolan,

...

base
[CPAN]Max Maischein,

...


...

Image Modified Image Modified Image Modified