Re: grep and smart match should warn in void context

[email protected] (demerphq)
Newsgroups perl.perl5.porters,perl.makemaker
Message-ID <[email protected]>
On 06/01/2008, Rafael Garcia-Suarez <[email protected]> wrote:
> On 06/01/2008, Rafael Garcia-Suarez <[email protected]> wrote:
> > On 23/12/2007, Michael G Schwern <[email protected]> wrote:
> > > Whoops, missed a revision there.  Use this patch instead.
> >
> > Thanks, applied as #32876.
>
> Oh, and I needed to patch MM_Unix.pm as follows, to avoid it emitting
> the new warning:
>
> Change 32879 by rgs@stcosmo on 2008/01/06 18:00:41
>
>         Don't use grep in scalar context
>
> Affected files ...
>
> ... //depot/perl/lib/ExtUtils/MM_Unix.pm#232 edit
>
> Differences ...
>
> ==== //depot/perl/lib/ExtUtils/MM_Unix.pm#232 (text) ====
>
> @@ -18,7 +18,7 @@
>
>  use ExtUtils::MakeMaker qw($Verbose neatvalue);
>
> -$VERSION = '6.42';
> +$VERSION = '6.42_01';
>
>  require ExtUtils::MM_Any;
>  @ISA = qw(ExtUtils::MM_Any);
> @@ -2453,7 +2453,7 @@
>         push @$extra, $_;
>      }
>
> -    grep(s/^(.*)/"-I$1"/, @{$perlinc || []});
> +    map(s/^(.*)/"-I$1"/, @{$perlinc || []});

/me wonders why that wasnt

  s/^(.*)/"-I$1"/ for @{$perlinc || []};

or even

  $_=qq("-l$_") for @{$perlinc || []};

cheers,
yves
-- 
perl -Mre=debug -e "/just|another|perl|hacker/"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.