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

People
Owner: Nobody in particular
Requestors: marks [...] iskoot.co.il
Cc:
AdminCc:

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



Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 0781063C504 for <bug-Perl-Critic [...] rt.cpan.org>; Thu, 26 Feb 2009 04:18:17 -0500 (EST)
Received: (qmail 31665 invoked by uid 103); 26 Feb 2009 09:18:16 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 26 Feb 2009 09:18:16 -0000
Received: from mail-gw.iskoot.co.il (HELO mail-gw.iskoot.co.il) (212.199.98.200) by 16.mx.develooper.com (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Feb 2009 01:18:13 -0800
Received: from [172.16.50.32] (172.16.50.32) by isk-exsrv1.iskoot.com (172.16.50.204) with Microsoft SMTP Server id 8.0.685.24; Thu, 26 Feb 2009 11:14:47 +0200
Delivered-To: cpan-bug+Perl-Critic [...] diesel.bestpractical.com
Subject: False Positive in Perl::Critic::Policy::BuiltinFunctions::ProhibitVoidMap
MIME-Version: 1.0
User-Agent: Thunderbird 2.0.0.19 (X11/20081227)
X-Spam-Status: No, hits=0.0 required=8.0 tests=
Return-Path: <MarkS [...] iskoot.co.il>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Perl-Critic [...] rt.cpan.org
Date: Thu, 26 Feb 2009 11:15:57 +0200
X-Spam-Level: *
content-type: text/plain; charset="utf-8"
Message-ID: <49A65DCD.4050202 [...] iskoot.co.il>
To: <bug-Perl-Critic [...] rt.cpan.org>
Content-Transfer-Encoding: 7bit
From: Mark Stern <marks [...] iskoot.co.il>
X-RT-Original-Encoding: ISO-8859-1
Content-Length: 196
Download (untitled) / with headers
text/plain 196b
The following code snippet produces a false positive: #!/usr/bin/perl use strict; use warnings; my @list = keys %{{map { $_ => 1 } qw(a b a c)}}; print "@list\n"; I am using version 1.093_01
MIME-Version: 1.0
X-Spam-Status: No, hits=-0.0 required=8.0 tests=SPF_PASS
In-Reply-To: <rt-3.6.HEAD-31384-1235639919-281.43651-4-0 [...] rt.cpan.org>
References: <RT-Ticket-43651 [...] rt.cpan.org> <49A65DCD.4050202 [...] iskoot.co.il> <rt-3.6.HEAD-31384-1235639919-281.43651-4-0 [...] rt.cpan.org>
Message-ID: <49A69687.5030401 [...] 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 [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id C033C4DCEDE for <bug-Perl-Critic [...] rt.cpan.org>; Thu, 26 Feb 2009 08:18:30 -0500 (EST)
Received: (qmail 3805 invoked by uid 103); 26 Feb 2009 13:18:29 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 26 Feb 2009 13:18:29 -0000
Received: from pendrell.textdrive.com (HELO pendrell.textdrive.com) (207.7.108.149) by 16.mx.develooper.com (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Feb 2009 05:18:27 -0800
Received: from quaquaversal.local (adsl-75-3-128-71.dsl.chcgil.sbcglobal.net [75.3.128.71]) by pendrell.textdrive.com (Postfix) with ESMTP id 1454FB9923 for <bug-Perl-Critic [...] rt.cpan.org>; Thu, 26 Feb 2009 13:18:00 +0000 (GMT)
Delivered-To: cpan-bug+Perl-Critic [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #43651] False Positive in Perl::Critic::Policy::BuiltinFunctions::ProhibitVoidMap
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 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, 26 Feb 2009 07:17:59 -0600
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-31384-1235654317-1983.43651-0-0 [...] rt.cpan.org>
Content-Length: 1254
Download (untitled) / with headers
text/plain 1.2k
Mark Stern via RT wrote: Show quoted text
> The following code snippet produces a false positive:
[chop] Show quoted text
> my @list = keys %{{map { $_ => 1 } qw(a b a c)}};
This is a PPI parsing bug. The second curly gets parsed as a block and not a hash constructor. PPI::Document PPI::Statement::Variable [ 1, 1, 1 ] PPI::Token::Word 'my' [ 1, 4, 4 ] PPI::Token::Symbol '@list' [ 1, 10, 10 ] PPI::Token::Operator '=' [ 1, 12, 12 ] PPI::Token::Word 'keys' [ 1, 17, 17 ] PPI::Token::Cast '%' PPI::Structure::Block { ... } PPI::Statement::Compound PPI::Structure::Block { ... } PPI::Statement [ 1, 20, 20 ] PPI::Token::Word 'map' PPI::Structure::Block { ... } PPI::Statement [ 1, 26, 26 ] PPI::Token::Magic '$_' [ 1, 29, 29 ] PPI::Token::Operator '=>' [ 1, 32, 32 ] PPI::Token::Number '1' [ 1, 36, 36 ] PPI::Token::QuoteLike::Words 'qw(a b a c)' [ 1, 49, 49 ] PPI::Token::Structure ';'
MIME-Version: 1.0 (Apple Message framework v930.3)
X-Spam-Status: No, hits=0.0 required=8.0 tests=
In-Reply-To: <rt-3.6.HEAD-31384-1235639919-281.43651-4-0 [...] rt.cpan.org>
X-Mailer: Apple Mail (2.930.3)
References: <RT-Ticket-43651 [...] rt.cpan.org> <49A65DCD.4050202 [...] iskoot.co.il> <rt-3.6.HEAD-31384-1235639919-281.43651-4-0 [...] rt.cpan.org>
Message-ID: <F32F4FB6-4582-4E33-BD6D-218A9C3A4CF8 [...] chrisdolan.net>
Content-Type: text/plain; charset="utf-8"; format="flowed"
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id ECDEF23C0EE for <bug-Perl-Critic [...] rt.cpan.org>; Fri, 27 Feb 2009 01:14:04 -0500 (EST)
Received: (qmail 5202 invoked by uid 103); 27 Feb 2009 06:14:04 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 27 Feb 2009 06:14:04 -0000
Received: from caibbdcaaaaf.dreamhost.com (HELO spaceymail-a7.g.dreamhost.com) (208.113.200.5) by 16.mx.develooper.com (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Feb 2009 22:14:02 -0800
Received: from [192.168.0.4] (h69-129-202-174.mdsnwi.broadband.dynamic.tds.net [69.129.202.174]) by spaceymail-a7.g.dreamhost.com (Postfix) with ESMTP id 7600514292; Thu, 26 Feb 2009 22:13:34 -0800 (PST)
Delivered-To: cpan-bug+Perl-Critic [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #43651] False Positive in Perl::Critic::Policy::BuiltinFunctions::ProhibitVoidMap
Return-Path: <chris [...] chrisdolan.net>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Perl-Critic [...] rt.cpan.org
Date: Fri, 27 Feb 2009 00:13:30 -0600
X-Spam-Level: *
To: bug-Perl-Critic [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Chris Dolan <chris [...] chrisdolan.net>
RT-Message-ID: <rt-3.6.HEAD-31384-1235715250-1356.43651-0-0 [...] rt.cpan.org>
Content-Length: 510
Download (untitled) / with headers
text/plain 510b
On Feb 26, 2009, at 3:18 AM, Mark Stern via RT wrote: Show quoted text
> The following code snippet produces a false positive: > > #!/usr/bin/perl > > use strict; > use warnings; > > my @list = keys %{{map { $_ => 1 } qw(a b a c)}}; > print "@list\n";
Instead of treating the symptom, why not treat the injury? my @list = keys %{{map { $_ => 1 } qw(a b a c)}}; print "@list\n" c a b use List::MoreUtils qw(uniq); my @list = uniq qw(a b a c); print "@list\n"; a b c But, yes, it is a PPI parsing bug as Elliot said. Chris


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.