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: 46971
Status: open
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)

Attachments


Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 05C6219B831C for <bug-Perl-Critic [...] rt.cpan.org>; Mon, 15 Jun 2009 17:52:47 -0400 (EDT)
Received: (qmail 11043 invoked by uid 103); 15 Jun 2009 21:52:47 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 15 Jun 2009 21:52:47 -0000
Received: from mailout2-3.pacific.net.au (HELO mailout2.pacific.net.au) (61.8.2.226) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Mon, 15 Jun 2009 14:52:40 -0700
Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout2.pacific.net.au (Postfix) with ESMTP id 640DD1676DA for <bug-Perl-Critic [...] rt.cpan.org>; Tue, 16 Jun 2009 07:52:36 +1000 (EST)
Received: from blah.blah (ppp2B23.dyn.pacific.net.au [61.8.43.35]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id D28238C29 for <bug-Perl-Critic [...] rt.cpan.org>; Tue, 16 Jun 2009 07:52:35 +1000 (EST)
Received: from gg by blah.blah with local (Exim 4.69) (envelope-from <gg [...] zip.com.au>) id 1MGK6U-0001GA-OB for bug-Perl-Critic [...] rt.cpan.org; Tue, 16 Jun 2009 07:52:34 +1000
Delivered-To: cpan-bug+Perl-Critic [...] diesel.bestpractical.com
MIME-Version: 1.0
User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.3 (gnu/linux)
Subject: ProhibitLocalVars on localized hash entry
X-Spam-Status: No, hits=0.0 required=8.0 tests=
Return-Path: <gg [...] zip.com.au>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Perl-Critic [...] rt.cpan.org
Date: Tue, 16 Jun 2009 07:52:34 +1000
X-Spam-Level: *
X-Virus-Checked: Checked by ClamAV on 16.mx.develooper.com
Content-Type: multipart/mixed; boundary="=-=-="
Message-ID: <87tz2hcggt.fsf [...] blah.blah>
To: bug-Perl-Critic [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
Content-Length: 0
X-RT-Original-Encoding: ascii
content-type: text/plain; charset="utf-8"
Content-Length: 545
Download (untitled) / with headers
text/plain 545b
I've had some success using "local" to make block-scoped hash value settings, like flags on an object for recursion protection etc, { local $self->{'update_in_progress'} = 1; ... } It'd be good if ProhibitLocalVars allowed expressions like that (array element, hash element, other sorts of dereference), on the basis the aim of the policy is to pick up places which ought to be "my" instead of "local". (Or alternatively, if the above is a bad idea then further notes in the docs about why the policy is flagging it ...)
Content-Type: text/x-diff
content-disposition: inline; filename="ProhibitLocalVars.run.hash-elem.diff"
Content-Length: 468
Index: ProhibitLocalVars.run =================================================================== --- ProhibitLocalVars.run (revision 3341) +++ ProhibitLocalVars.run (working copy) @@ -27,6 +27,8 @@ local $SIG{HUP} \&handler; local $INC{$module} = $path; +local $self->{'update_in_progress'} = $path; + #----------------------------------------------------------------------------- ##############################################################################
MIME-Version: 1.0
X-Spam-Status: No, hits=-0.0 required=8.0 tests=SPF_PASS
In-Reply-To: <rt-3.6.HEAD-13950-1245102783-634.46971-4-0 [...] rt.cpan.org>
References: <RT-Ticket-46971 [...] rt.cpan.org> <87tz2hcggt.fsf [...] blah.blah> <rt-3.6.HEAD-13950-1245102783-634.46971-4-0 [...] rt.cpan.org>
Message-ID: <4A3FDC39.8040706 [...] galumph.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 049394D80C0 for <bug-Perl-Critic [...] rt.cpan.org>; Mon, 22 Jun 2009 15:32:23 -0400 (EDT)
Received: (qmail 10155 invoked by uid 103); 22 Jun 2009 19:32:23 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 22 Jun 2009 19:32:23 -0000
Received: from pendrell.textdrive.com (HELO pendrell.textdrive.com) (207.7.108.149) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Mon, 22 Jun 2009 12:32:16 -0700
Received: from CMU-339568.WV.CC.CMU.EDU (CMU-339568.WV.CC.CMU.EDU [128.237.234.48]) by pendrell.textdrive.com (Postfix) with ESMTP id BFEC2BB9A5 for <bug-Perl-Critic [...] rt.cpan.org>; Mon, 22 Jun 2009 19:32:11 +0000 (GMT)
Delivered-To: cpan-bug+Perl-Critic [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #46971] ProhibitLocalVars on localized hash entry
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.0
Return-Path: <perl [...] galumph.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Perl-Critic [...] rt.cpan.org
Date: Mon, 22 Jun 2009 15:32:09 -0400
X-Spam-Level: *
To: bug-Perl-Critic [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Elliot Shank <perl [...] galumph.com>
RT-Message-ID: <rt-3.6.HEAD-13950-1245699157-1933.46971-0-0 [...] rt.cpan.org>
Content-Length: 646
Download (untitled) / with headers
text/plain 646b
Kevin Ryde via RT wrote: Show quoted text
> I've had some success using "local" to make block-scoped hash value > settings, like flags on an object for recursion protection etc,
Interesting. I never thought about applying "local" to a lexical hash reference. I've localized individual values in a global hash before, of course, but never in a lexical one. I'm thinking that the current behavior should still be the default, simply to discourage use of local by those who don't know what's going on, but assuming that you do know what it's doing, I see no reason to complain about it. So, I think we should have an option for this to turn this situation off.
MIME-Version: 1.0
X-Spam-Status: No, hits=0.0 required=8.0 tests=
In-Reply-To: <rt-3.6.HEAD-13950-1245699157-1933.46971-6-0 [...] rt.cpan.org> (Elliot Shank via's message of "Mon, 22 Jun 2009 15:32:38 -0400")
References: <RT-Ticket-46971 [...] rt.cpan.org> <87tz2hcggt.fsf [...] blah.blah> <rt-3.6.HEAD-13950-1245102783-634.46971-4-0 [...] rt.cpan.org> <4A3FDC39.8040706 [...] galumph.com> <rt-3.6.HEAD-13950-1245699157-1933.46971-6-0 [...] rt.cpan.org>
Message-ID: <87tz25td7n.fsf [...] blah.blah>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 915324D80D7 for <bug-Perl-Critic [...] rt.cpan.org>; Wed, 24 Jun 2009 19:39:02 -0400 (EDT)
Received: (qmail 2645 invoked by uid 103); 24 Jun 2009 23:39:02 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 24 Jun 2009 23:39:02 -0000
Received: from mailout2-1.pacific.net.au (HELO mailout2.pacific.net.au) (61.8.2.224) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Wed, 24 Jun 2009 16:38:54 -0700
Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout2.pacific.net.au (Postfix) with ESMTP id 63DEF1775CB for <bug-Perl-Critic [...] rt.cpan.org>; Thu, 25 Jun 2009 09:38:51 +1000 (EST)
Received: from blah.blah (ppp29A7.dyn.pacific.net.au [61.8.41.167]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id CF2E927434 for <bug-Perl-Critic [...] rt.cpan.org>; Thu, 25 Jun 2009 09:38:45 +1000 (EST)
Received: from gg by blah.blah with local (Exim 4.69) (envelope-from <gg [...] zip.com.au>) id 1MJc2X-0002CB-2u for bug-Perl-Critic [...] rt.cpan.org; Thu, 25 Jun 2009 09:38:05 +1000
Delivered-To: cpan-bug+Perl-Critic [...] diesel.bestpractical.com
User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.3 (gnu/linux)
Subject: Re: [rt.cpan.org #46971] ProhibitLocalVars on localized hash entry
Return-Path: <gg [...] zip.com.au>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Perl-Critic [...] rt.cpan.org
Date: Thu, 25 Jun 2009 09:38:04 +1000
X-Spam-Level: *
To: bug-Perl-Critic [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
RT-Message-ID: <rt-3.6.HEAD-4110-1245886762-1561.46971-0-0 [...] rt.cpan.org>
Content-Length: 421
Download (untitled) / with headers
text/plain 421b
"Elliot Shank via RT" <bug-Perl-Critic@rt.cpan.org> writes: Show quoted text
> > I think we should have an option for this to turn this situation off.
I shouldn't think anyone could write "local $foo->{...}" without meaning it, it couldn't be a mistaken "my"; so I wouldn't worry about an option. Perhaps keep it nice and narrow though, just a hash or array dereference ie. local $foo->..., initially if you like, and see how that goes.
MIME-Version: 1.0
X-Spam-Status: No, hits=-0.0 required=8.0 tests=SPF_PASS
In-Reply-To: <rt-3.6.HEAD-4110-1245886762-1561.46971-5-0 [...] rt.cpan.org>
References: <RT-Ticket-46971 [...] rt.cpan.org> <87tz2hcggt.fsf [...] blah.blah> <rt-3.6.HEAD-13950-1245102783-634.46971-4-0 [...] rt.cpan.org> <4A3FDC39.8040706 [...] galumph.com> <rt-3.6.HEAD-13950-1245699157-1933.46971-6-0 [...] rt.cpan.org> <87tz25td7n.fsf [...] blah.blah> <rt-3.6.HEAD-4110-1245886762-1561.46971-5-0 [...] rt.cpan.org>
Message-ID: <4A43630D.30304 [...] galumph.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id D550619B8247 for <bug-Perl-Critic [...] rt.cpan.org>; Thu, 25 Jun 2009 07:44:25 -0400 (EDT)
Received: (qmail 3100 invoked by uid 103); 25 Jun 2009 11:44:25 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 25 Jun 2009 11:44:25 -0000
Received: from pendrell.textdrive.com (HELO pendrell.textdrive.com) (207.7.108.149) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Thu, 25 Jun 2009 04:44:18 -0700
Received: from emdaer.local (CMU-339568.WV.CC.CMU.EDU [128.237.234.48]) by pendrell.textdrive.com (Postfix) with ESMTP id 81F1FBB6D3 for <bug-Perl-Critic [...] rt.cpan.org>; Thu, 25 Jun 2009 11:44:15 +0000 (GMT)
Delivered-To: cpan-bug+Perl-Critic [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #46971] ProhibitLocalVars on localized hash entry
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.22) Gecko/20090605 Thunderbird/2.0.0.22 Mnenhy/0.7.5.0
Return-Path: <perl [...] galumph.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Perl-Critic [...] rt.cpan.org
Date: Thu, 25 Jun 2009 07:44:13 -0400
X-Spam-Level: *
To: bug-Perl-Critic [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Elliot Shank <perl [...] galumph.com>
RT-Message-ID: <rt-3.6.HEAD-4110-1245930286-1301.46971-0-0 [...] rt.cpan.org>
Content-Length: 442
Download (untitled) / with headers
text/plain 442b
Kevin Ryde via RT wrote: Show quoted text
> "Elliot Shank via RT" <bug-Perl-Critic@rt.cpan.org> writes:
>> I think we should have an option for this to turn this situation off.
> > I shouldn't think anyone could write "local $foo->{...}" without meaning > it, it couldn't be a mistaken "my"; so I wouldn't worry about an option.
You don't? What fantasy island do you live on? I guarantee you that beginners get mixed up between my and local all the time.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.