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: 38678
Status: resolved
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

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



Subject: ProtectPrivateSubs allow POSIX::_SC_CLK_TCK() and friends
Date: Sat, 23 Aug 2008 09:01:18 +1000
To: bug-perl-critic [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
In ProtectPrivateSubs it'd be good if the various standard POSIX module conf constants like _PC_LINK_MAX, _POSIX_ARG_MAX and _SC_CLK_TCK were not considered private, so you can use them unimported like require POSIX; print POSIX::sysconf(POSIX::_SC_CLK_TCK()),"\n"; Hopefully there's not too many "_" exceptions like this to make. The only other I know of would be Encode::_utf8_on() and _utf8_off(), which I'm not 100% sure if you're really meant to use, or unless you know what you're doing.
Subject: Re: [rt.cpan.org #38678] ProtectPrivateSubs allow POSIX::_SC_CLK_TCK() and friends
Date: Fri, 22 Aug 2008 20:30:06 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Kevin Ryde via RT wrote: Show quoted text
> In ProtectPrivateSubs it'd be good if the various standard POSIX module > conf constants like _PC_LINK_MAX, _POSIX_ARG_MAX and _SC_CLK_TCK were > not considered private, so you can use them unimported like > > require POSIX; > print POSIX::sysconf(POSIX::_SC_CLK_TCK()),"\n"; > > Hopefully there's not too many "_" exceptions like this to make.
Looking at the documentation for POSIX, there's a bunch of them. Ugh. But I agree that these should be allowed. Show quoted text
> The only other I know of would be Encode::_utf8_on() and _utf8_off(), > which I'm not 100% sure if you're really meant to use, or unless you > know what you're doing.
Uh, yeah, they're under a heading of "Messing with Perl Internals". I'm not inclined to let these pass by default. So, I'm thinking that we add an option to the policy that lists exceptions that defaults to including the POSIX subroutines and would allow you to add the Encoding ones (or whatever else).
Subject: Re: [rt.cpan.org #38678] ProtectPrivateSubs allow POSIX::_SC_CLK_TCK() and friends
Date: Wed, 27 Aug 2008 11:28:39 +1000
To: bug-Perl-Critic [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
"Elliot Shank via RT" <bug-Perl-Critic@rt.cpan.org> writes: Show quoted text
> > So, I'm thinking that we add an option to the policy that lists > exceptions that defaults to including the POSIX subroutines and would > allow you to add the Encoding ones (or whatever else).
Exceptions added on top of the builtins? Yep, that sounds likely. (Dunno if you'd want to turn off the builtins. Perhaps on occasion, as a separate option.)
Subject: Re: [rt.cpan.org #38678] ProtectPrivateSubs allow POSIX::_SC_CLK_TCK() and friends
Date: Tue, 26 Aug 2008 20:44:14 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Kevin Ryde via RT wrote: Show quoted text
> Queue: Perl-Critic > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=38678 > > > "Elliot Shank via RT" <bug-Perl-Critic@rt.cpan.org> writes:
>> So, I'm thinking that we add an option to the policy that lists >> exceptions that defaults to including the POSIX subroutines and would >> allow you to add the Encoding ones (or whatever else).
> > Exceptions added on top of the builtins? Yep, that sounds likely. > (Dunno if you'd want to turn off the builtins. Perhaps on occasion, as > a separate option.)
Builtins? There's no builtin functions that start with underscore that I know of.
Subject: Re: [rt.cpan.org #38678] ProtectPrivateSubs allow POSIX::_SC_CLK_TCK() and friends
Date: Wed, 27 Aug 2008 12:00:11 +1000
To: bug-Perl-Critic [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
"Elliot Shank via RT" <bug-Perl-Critic@rt.cpan.org> writes: Show quoted text
> > Builtins? There's no builtin functions that start with underscore > that I know of.
You know what I mean, the likes of POSIX that come with the core, wide use, whatnot ...
Subject: Re: [rt.cpan.org #38678] ProtectPrivateSubs allow POSIX::_SC_CLK_TCK() and friends
Date: Thu, 28 Aug 2008 10:26:24 +1000
To: bug-Perl-Critic [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
Actually I confused myself. What I meant was that in your .perlcriticrc you're a good chance of wanting to keep the exceptions that perlcritic has builtin, just add a few of your own ...
In progress. POSIX::_\w+ is exempted by default, and an 'allow' configuration option will allow user-configured exemptions. Tom Wyant
Proposed fix committed as revision 3103. Added 'accept' configuration item, pre-loaded with everything in @POSIX::EXPORT that begins with an underscore.
This has been completed and released in Perl-Critic-1.097_002. http://search.cpan.org/~elliotjs/Perl-Critic-1.097_002 Thank you for submitting this ticket.