in reply to Re^2: Ways to delete start of string
in thread Ways to delete start of string
Whatever code snippets you supply to benchmark, get wrapped internally into subs
That's true. That's why I usually do
$_ = "use strict; use warnings; for (1..10_000) { my \$x = '|0|0|0|0|0 +|0|'; $_ }";
to minimize the cost of that sub call.
Also, I'm not sure what the cost of use strict; and use warnings is, when they have already been loaded,
Zero. use is executed once, at compile-time. It doesn't generate any code in the tree.
>perl -MO=Concise -e"use strict; print 'a'" 6 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 2 -e:1) v/2 ->3 5 <@> print vK ->6 3 <0> pushmark s ->4 4 <$> const[PV "a"] s ->5 -e syntax OK
|
|---|