develooper Front page | perl.perl5.porters | Postings from February 2018

Re: [perl.git] branch blead updated. v5.27.8-367-g7bb6e12450

Thread Next
From:
demerphq
Date:
February 24, 2018 03:40
Subject:
Re: [perl.git] branch blead updated. v5.27.8-367-g7bb6e12450
Message ID:
CANgJU+Xv-r5T9P=KFk=eyPEo3FTJ4UsbtLjN7nsj9bL34_-UJw@mail.gmail.com
This breaks .pmc's

Which I already posted about. I am not sure if we should care tho.

Yves

On 24 February 2018 at 04:33, Father Chrysostomos <sprout@cpan.org> wrote:
> In perl.git, the branch blead has been updated
>
> <https://perl5.git.perl.org/perl.git/commitdiff/7bb6e12450c58b7094ccdfa7025fa495d3996bcf?hp=b4dcd72d7c1fd970030db81f13b3824d51aeb9b6>
>
> - Log -----------------------------------------------------------------
> commit 7bb6e12450c58b7094ccdfa7025fa495d3996bcf
> Author: Father Chrysostomos <sprout@cpan.org>
> Date:   Fri Feb 23 19:32:51 2018 -0800
>
>     Carp: Avoid string eval
>
>     Carp’s particular use of string eval is unnecessary in this case, and
>     slower than the alternative.  Carp’s reason for using string eval is
>     to avoid the effect of bareword require vivifying a package.  But that
>     only applies to bareword require, and not other forms of require:
>
>     $ perl -le 'print $::{"overload::"}||"nothing"; require overload'
>     *main::overload::
>     $ perl -le 'print $::{"overload::"}||"nothing"; require "overload.pm"'
>     nothing
>
>     Since string eval has to set up a parser and a new scope, it is much
>     slower that require, and quite unnecessary here.
>
> -----------------------------------------------------------------------
>
> Summary of changes:
>  dist/Carp/lib/Carp.pm | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/dist/Carp/lib/Carp.pm b/dist/Carp/lib/Carp.pm
> index 610e07fe1a..3de78d9f6f 100644
> --- a/dist/Carp/lib/Carp.pm
> +++ b/dist/Carp/lib/Carp.pm
> @@ -343,10 +343,10 @@ sub format_arg {
>                 # so we need to use overload::StrVal() below.  But it's
>                 # possible that the overload module hasn't been loaded:
>                 # overload methods can be installed without it.  So load
> -               # the module here.  The eval layer here avoids the
> -               # compile-time effect of require vivifying the target
> -               # module's stash.
> -                eval "require overload; 1"
> +               # the module here.  The bareword form of require is here
> +               # eschewed to avoid iths compile-time effect of vivifying
> +               # vivifying the target module's stash.
> +                require "overload.pm"
>                      or return "use overload failed";
>              }
>              my $sub = _fetch_sub(overload => 'StrVal');
>
> --
> Perl5 Master Repository



-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

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