in reply to Re: Re: "switch$ia" (Russ: Useless Benchmarking again)
in thread "switch$ia" but don't interpolate trailing "a"
You are correct, at least according to the B::Deparse documentation. Interpolation is just syntactic sugar for concatenation. You can see it for yourself:
$ perl -MO=Deparse,-p,-q -e '$foo = "BAR"; $bar = "a${foo}c"; $baz="a" +.$foo."c"' ($foo = 'BAR'); ($bar = (('a' . $foo) . 'c')); ($baz = (('a' . $foo) . 'c'));
Update: Added concatenation to the example for comparison. Also, the output using B::Terse to dump the opcode tree may be more convincing.
|
---|