Perl::Critic::Policy::Community::WarningsSwitch(3pm)

Perl::Critic::Policy::Community::WarningsSwitch3pm

Scripts should not use the -w switch on the shebang line

Overview

The "-w" switch enables warnings globally in a perl program, including for any modules that did not explicitly enable or disable any warnings. The "-W" switch enables warnings even for modules that explicitly disabled them. The primary issue with this is enabling warnings for code that you did not write. Some of these modules may not be designed to run with warnings enabled, but still work fine. Instead, use warnings within your own code only.

  #!/usr/bin/perl -w # not ok
  #!/usr/bin/perl -W # not ok
  use warnings;      # ok

Affiliation

This policy is part of Perl::Critic::Community.

Configuration

This policy is not configurable except for the standard options.

Releases

2 releases since Debian 12 (Bookworm); the text changed 1 time.

  1. 12
  2. 13

Author

Dan Book, "[email protected]"

From libperl-critic-community-perl 1.0.4-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.