Home > Net >  What is -w in a Perl shebang line? [closed]
What is -w in a Perl shebang line? [closed]

Time:09-17

I have been seeing this

#!/usr/local/bin/perl -w 

in some of the perl scripts. I would like to know what does this -w stands for.

CodePudding user response:

The perlrun docs show all of the command-line options. -w enables global warnings.

However, that's a legacy feature. Modern code uses the warnings pragma to enable warnings only in the current scope:

#!/usr/bin/perl
use warnings;
  •  Tags:  
  • perl
  • Related