in reply to Re: A plague on all your features
in thread A plague on all your features

$VAR1 = { 'a' => undef, 'b' => { 'feature_bareword_filehandles' => 1, 'feature_indirect' => 1, 'feature_multidimensional' => 1, 'feature_say' => 1, 'feature_state' => 1, 'feature_switch' => 1 }, 'c' => undef, 'd' => { 'feature_bareword_filehandles' => 1, 'feature_indirect' => 1, 'feature_multidimensional' => 1, 'feature_say' => 1, 'feature_state' => 1, 'feature_switch' => 1 }, 'e' => { 'feature_bareword_filehandles' => 1, 'feature_indirect' => 1, 'feature_multidimensional' => 1, 'feature_say' => 1 }, 'f' => { 'feature_bareword_filehandles' => 1, 'feature_indirect' => 1, 'feature_multidimensional' => 1 }, 'g' => { 'feature_bareword_filehandles' => 1, 'feature_indirect' => 1, 'feature_multidimensional' => 1 } };

Replies are listed 'Best First'.
Re^3: A plague on all your features
by ikegami (Patriarch) on Mar 07, 2023 at 00:58 UTC

    I don't know why the hints are undef for c, but I can confirm it's accurate.

    $ diff -u \ <( perl -MO=Concise,b b.pl 2>&1 ) \ <( perl -MO=Concise,c b.pl 2>&1 ) --- /dev/fd/63 2023-03-06 20:59:39.932888013 -0400 +++ /dev/fd/62 2023-03-06 20:59:39.932888013 -0400 @@ -1,8 +1,8 @@ b.pl syntax OK -main::b: +main::c: 5 <1> leavesub[1 ref] K/REFC,1 ->(end) - <@> lineseq KP ->5 -1 <;> nextstate(main 1252 b.pl:15) v:%,*,&,x*,x&,x$,fea=15 ->2 +1 <;> nextstate(main 1257 b.pl:16) v:*,&,x*,x&,x$,fea=1 ->2 4 <1> entersub KS ->5 - <1> ex-list K ->4 2 <0> pushmark s ->3

    Note the different value of the hints (fea= for "feature") for the two lines.

      Actually, the whole v: thing is the hints, not just the fea= portion. And we see another difference: The %. Not sure what it means, but it relates to %^H. Presumably the presence of %^H. Again, present for b but not c.

        b has a %^H and c doesn't. The extra time spent is clearly spent accessing (copying?) this hash.


        Why doesn't c have a %^H?

        Some hints are found in $^H and some are in %^H.

        I think what's happening is that use 5.010; avoids creating %^H just to set flags that are on by default (such as indirect).

        use feature ":5:10";, on the other hand, clearly does create this hash.

        There's a problem with this answer. say and a couple other flags which aren't set by default appear to be in %^H. Maybe they are found in both $^H and %^H?