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

People
Owner: Nobody in particular
Requestors: amir.aharoni [...] mail.huji.ac.il
Cc:
AdminCc:

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



Subject: Variables::ProhibitPunctuationVars - %+ has no English equivalent
(I am sorry if it has been already reported. I couldn't find it.) In Perl 5.10 there's a new punctuation variable %+ . It has no English alias. Maybe it's a bug in perl 5.10 and it should have an alias, but currently it doesn't. Perl::Critic identifies its use as "Magic punctuation variable used". Furthermore, the variable is %+ , but it is usually used with a $ : $+{capture_name}. Saying this in .perlcriticrc doesn't help: [Variables::ProhibitPunctuationVars] allow = %+ But saying this helps: [Variables::ProhibitPunctuationVars] allow = $+ A simple testcase is attached. Maybe i am missing something and it is the correct behavior. If it is indeed correct, please document it in the manpage of Variables::ProhibitPunctuationVars . Thanks. Thanks in advance. (Comment: This is perl 5.10 on cygwin and Windows Vista.)
Subject: test_punct_01.pl
#!/usr/bin/perl use 5.010; use strict; use warnings; our $VERSION = 0.1; my $string = 'hello'; if ($string =~ /(?<vowel>[aeiou])/xms) { say "$string has the vowel ", $+{vowel}; } else { say "$string has no vowels"; } exit; __END__
Subject: Re: [rt.cpan.org #35969] Variables::ProhibitPunctuationVars - %+ has no English equivalent
Date: Sat, 17 May 2008 12:10:28 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Amir E. Aharoni via RT wrote: Show quoted text
> In Perl 5.10 there's a new punctuation variable %+ . > > It has no English alias. Maybe it's a bug in perl 5.10 and it should > have an alias, but currently it doesn't.
Actually, it does. It's %LAST_PAREN_MATCH.
From: amir.aharoni [...] gmail.com
On Sat May 17 13:11:23 2008, clonezone wrote: Show quoted text
> Amir E. Aharoni via RT wrote:
> > In Perl 5.10 there's a new punctuation variable %+ . > > > > It has no English alias. Maybe it's a bug in perl 5.10 and it should > > have an alias, but currently it doesn't.
> > Actually, it does. It's %LAST_PAREN_MATCH.
Oh, thanks. The perlvar manpage doesn't make it clear. (At least the version at http://perldoc.perl.org/perlvar.html )
Subject: Re: [rt.cpan.org #35969] Variables::ProhibitPunctuationVars - %+ has no English equivalent
Date: Sat, 17 May 2008 12:28:48 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Amir E. Aharoni via RT wrote: Show quoted text
> On Sat May 17 13:11:23 2008, clonezone wrote:
>> Amir E. Aharoni via RT wrote:
>>> In Perl 5.10 there's a new punctuation variable %+ . >>> >>> It has no English alias. Maybe it's a bug in perl 5.10 and it should >>> have an alias, but currently it doesn't.
>> >> Actually, it does. It's %LAST_PAREN_MATCH.
> > Oh, thanks. > > The perlvar manpage doesn't make it clear. (At least the version at > http://perldoc.perl.org/perlvar.html )
Yeah, it's put with $+, not %+.
Subject: Re: [rt.cpan.org #35969] Variables::ProhibitPunctuationVars - %+ has no English equivalent
Date: Sat, 17 May 2008 12:33:23 -0500
To: bug-Perl-Critic [...] rt.cpan.org
From: Elliot Shank <perl [...] galumph.com>
Elliot Shank wrote: Show quoted text
> Amir E. Aharoni via RT wrote:
>> In Perl 5.10 there's a new punctuation variable %+ . >> >> It has no English alias. Maybe it's a bug in perl 5.10 and it should >> have an alias, but currently it doesn't.
> > Actually, it does. It's %LAST_PAREN_MATCH.
Or, you can use %LAST_MATCH_END.