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

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.

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

    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?