Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Re: "switch$ia" (Russ: Useless Benchmarking again)

by Fletch (Bishop)
on Oct 10, 2001 at 21:29 UTC ( [id://118062]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://118062]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2024-04-20 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found