in reply to Re: Perl Concatenate vs Append Operator
in thread Perl Concatenate vs Append Operator
There are some differences on the ante-penultimate and penultimate lines. But I am not really able to assess whether the difference is significant. The Deparse module also gives different output for these two lines in Perl 5.14.$ perl -MO=Terse -E'my $str = "McA"; $str = $str . " ";' LISTOP (0x600153910) leave [1] OP (0x60007fdb0) enter COP (0x60006e3c0) nextstate BINOP (0x6001f1ea0) sassign SVOP (0x60006e2e0) const [3] PV (0x6001f2c08) "McA" OP (0x60006f890) padsv [1] COP (0x6001f7fe0) nextstate BINOP (0x6001f7fa0) concat [1] OP (0x600153980) padsv [1] SVOP (0x6001f7f60) const [4] PV (0x6001f2b78) " " -e syntax OK $ perl -MO=Terse -E'my $str = "McA"; $str .= " ";' LISTOP (0x600153910) leave [1] OP (0x60007fdb0) enter COP (0x60006e3c0) nextstate BINOP (0x6001f1ea0) sassign SVOP (0x60006e2e0) const [3] PV (0x6001f2c08) "McA" OP (0x60006f890) padsv [1] COP (0x6001f7f60) nextstate BINOP (0x6001539c0) concat [2] OP (0x600153950) padsv [1] SVOP (0x600153980) const [4] PV (0x6001f2b78) " " -e syntax OK
|
|---|