Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 70870
Status: open
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: gstainsb [...] bigpond.net.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: RequireUseWarnings ignores #! -w switch
Date: Sun, 11 Sep 2011 18:00:07 +1000
To: <bug-perl-critic [...] rt.cpan.org>
From: "Gerard Stainsby" <gstainsb [...] bigpond.net.au>
while modules obviously require an explicit use warnings; because they are not directly invoked, the perl interpreter parses the #!/usr/bin/perl line of scripts, and turns on warnings if -w is specified. Shouldn't this be enough? I don't want to turn off the rule in case I inadvertently leave off the -w switch, and I agree warnings are important. Gerard
Subject: Re: [rt.cpan.org #70870] RequireUseWarnings ignores #! -w switch
Date: Sun, 11 Sep 2011 10:28:18 -0700
To: bug-Perl-Critic [...] rt.cpan.org
From: Jeffrey Thalhammer <jeff [...] imaginative-software.com>
On Sep 11, 2011, at 1:00 AM, Gerard Stainsby via RT wrote: Show quoted text
> while modules obviously require an explicit > > use warnings; > > because they are not directly invoked, the perl interpreter > parses the #!/usr/bin/perl line of scripts, and turns on warnings > if -w is specified.
The warnings pragma is a much better way to activate warnings than the -w flag. See http://perldoc.perl.org/perllexwarn.html for details (especially the section: What's Wrong With "-w"). -Jeff