Hallo Beat!
perl -MO=Terse -e'$somevar = "text $var text"; $somevar = "text ".$var." text";'
Es ist mir leider nicht gelungen, den onliner auf meinem XP zum Laufen zu bringen.
Bei Windows muss es mit " anfangen, was zum Escape der reelen " zwingt:
perl -MO=Terse -e"$somevar = "text $var text"; $somevar = "text ".$var." text";"
so geht's doch:
C:>perl -MO=Terse -e"$somevar = "text $var text"; $somev
ar = "text ".$var." text";"
LISTOP (0x31c33e8) leave [1]
OP (0x31c3240) enter
COP (0x31c340c) nextstate
BINOP (0x31c3448) sassign
UNOP (0x31c3488) null [67]
OP (0x31c346c) null [3]
BINOP (0x31c34ac) concat [4]
BINOP (0x31c34d0) concat [3]
SVOP (0x31c3554) const [10] PV (0x283cfdc) "text "
UNOP (0x31c3514) null [15]
PADOP (0x31c3534) gvsv GV (0x283d04c) *var
SVOP (0x31c34f4) const [11] PV (0x283d00c) " text"
UNOP (0x31c3574) null [15]
PADOP (0x31c3594) gvsv GV (0x283cfbc) *somevar
COP (0x31c3280) nextstate
BINOP (0x31c32bc) sassign
BINOP (0x31c32e0) concat [9]
BINOP (0x31c3324) concat [8]
SVOP (0x31c3388) const [5] PV (0x283d06c) "text "
UNOP (0x31c3348) null [15]
PADOP (0x31c3368) gvsv GV (0x283d04c) *var
SVOP (0x31c3304) const [12] PV (0x283d08c) " text"
UNOP (0x31c33a8) null [15]
PADOP (0x31c33c8) gvsv GV (0x283cfbc) *somevar
-e syntax OK
C:>
Viele Grüße aus Frankfurt/Main,
Patrick