develooper Front page | perl.perl5.porters | Postings from August 2013

[perl #54728] PathTools-3.27 triggers a bug in Perl

Thread Previous | Thread Next
From:
Victor Efimov via RT
Date:
August 6, 2013 13:30
Subject:
[perl #54728] PathTools-3.27 triggers a bug in Perl
Message ID:
rt-3.6.HEAD-2552-1375795817-1101.54728-15-0@perl.org
I've tried to grep CPAN to find examples of use of regexps before @_

so here they are:

## bug:

https://metacpan.org/source/ADAMK/Params-Util-1.07/lib/Params/Util.pm#L191
(https://rt.cpan.org/Public/Bug/Display.html?id=87649
https://rt.cpan.org/Public/Bug/Display.html?id=81276)

## possible bug:
https://metacpan.org/source/FLORA/NEXT-0.65/lib/NEXT.pm#L147
https://metacpan.org/source/ADAMK/pip-1.19/lib/pip.pm#L99

## not affected, because no capture groups:
https://metacpan.org/source/PJF/autodie-2.20/lib/Fatal.pm#L194
https://metacpan.org/source/MELO/Redis-1.961/lib/Redis.pm#L101
https://metacpan.org/source/FLORA/bignum-0.32/lib/bigint.pm#L34
https://metacpan.org/source/TOBYINK/Test-Tabs-0.003/lib/Test/Tabs.pm#L148
https://metacpan.org/source/GAAS/Data-Dump-1.22/lib/Data/Dump.pm#L86
https://metacpan.org/source/STBEY/Date-Calc-6.3/lib/Date/Calendar/Year.pm#L87

## not affected: private subroutine, no possibility to call with $1, etc
https://metacpan.org/source/ADAMK/pip-1.19/lib/pip.pm#L99
https://metacpan.org/source/FLORA/bignum-0.32/lib/bigint.pm#L205
https://metacpan.org/source/GAAS/HTTP-Cookies-6.01/lib/HTTP/Cookies.pm#L598


On Tue Aug 06 04:42:19 2013, vsespb wrote:
> On Tue Aug 06 04:24:55 2013, davem wrote:
> > On Mon, Aug 05, 2013 at 08:42:48AM -0700, Victor Efimov via RT wrote:
> > 
> > > Also, isn't this a misfeature?
> > 
> > I don't see why.
> > >
> 
> a) is there a valid case when user indeed wants 'aa' =~ m/(.)/ to modify
> $_[1], in code like this?
> 
> "2" =~ m/(.*)/;
> print test1("1", $1), "\n";
> 
> sub test1 {
>  'aa' =~ m/(.)/;
>  return $_[0].'/'.$_[1];
> }
> 
> b) I think using regexps with capture groups, before using $_[], or @_,
> or &othersub; without expecting side effects is much more usable than
> this feature.
> 




---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=54728

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About