Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: String concatenation

by dave_the_m (Parson)
on Apr 11, 2012 at 20:57 UTC ( #964626=note: print w/ replies, xml ) Need Help??


in reply to Re^2: String concatenation
in thread String concatenation

In fact it goes further than that; the dot form also compiles to the same optree as the interpolation forms.

Dave.


Comment on Re^3: String concatenation
Replies are listed 'Best First'.
Re^4: String concatenation
by JavaFan (Canon) on Apr 11, 2012 at 21:22 UTC
    Hmmm.
    $ perl -MO=Terse -e '$v1.$v2.$v3' LISTOP (0x9dc5fe0) leave [1] OP (0x9dc6768) enter COP (0x9dd0650) nextstate BINOP (0x9dd06e0) concat [2] BINOP (0x9dd05b0) concat [1] UNOP (0x9dd0688) null [15] SVOP (0x9dd07e8) gvsv GV (0x9dcaa30) *v1 UNOP (0x9dd0578) null [15] SVOP (0x9dd0630) gvsv GV (0x9dcaa58) *v2 UNOP (0x9dd05d0) null [15] SVOP (0x9dcf9e0) gvsv GV (0x9dcaae4) *v3 -e syntax OK $ perl -MO=Terse -e '"$v1$v2$v3"' LISTOP (0x8b92778) leave [1] OP (0x8b88768) enter COP (0x8b92650) nextstate UNOP (0x8b926e0) null [67] OP (0x8b918d0) null [3] BINOP (0x8b925d0) concat [2] BINOP (0x8b925b0) concat [1] UNOP (0x8b92688) null [15] SVOP (0x8b927e8) gvsv GV (0x8b8ca44) *v1 UNOP (0x8b92578) null [15] SVOP (0x8b92630) gvsv GV (0x8b8cb34) *v2 UNOP (0x8b91920) null [15] SVOP (0x8b91a10) gvsv GV (0x8b8cae4) *v3 -e syntax OK
    Similar, but subtle differences.

      What actually executes is the same:

      $ perl -MO=Terse,-exec -e '$v1.$v2.$v3' OP (0x16e5ad0) enter COP (0x1817650) nextstate PADOP (0x16e6eb0) gvsv GV (0x16e3b68) *v1 PADOP (0x16e5b80) gvsv GV (0x16e3b98) *v2 BINOP (0x16e5a50) concat [3] PADOP (0x16e4c00) gvsv GV (0x16bee88) *v3 BINOP (0x16d5aa0) concat [5] LISTOP (0x16e4ca0) leave [1] -e syntax OK $ perl -MO=Terse,-exec -e '"$v1$v2$v3"' OP (0x1ecc200) enter COP (0x200d6b0) nextstate PADOP (0x1edac60) gvsv GV (0x1ed9b80) *v1 PADOP (0x1edbd40) gvsv GV (0x1ed9ca0) *v2 BINOP (0x1edba90) concat [3] PADOP (0x1edba50) gvsv GV (0x1eb4e88) *v3 BINOP (0x1ecbaa0) concat [5] LISTOP (0x1edb9d0) leave [1] -e syntax OK

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2015-07-30 17:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls