in reply to Re: Assigning the result of a chomp to the chomped var itself.
in thread Assigning the result of a chomp to the chomped var itself.

Interesting...

$ perl -wMstrict -e 'my $x = "a\n"; $x = chomp $x; print "<$x>\n"' <0> $ perl -wMstrict -e 'our $x = "a\n"; $x = chomp $x; print "<$x>\n"' <1> $ perl -wMstrict -MO=Terse -e 'our $x; $x = chomp $x;' LISTOP (0x8aa33b8) leave [1] OP (0x8aa3694) enter COP (0x8aa33dc) nextstate UNOP (0x8aa3414) null [15] SVOP (0x8aa3434) gvsv GV (0x8a9e5c0) *x COP (0x8aa36b8) nextstate BINOP (0x8aa36f0) sassign UNOP (0x8aa3714) schomp [2] UNOP (0x8aa3750) null [149] UNOP (0x8aa3774) null [15] SVOP (0x8aa3794) gvsv GV (0x8a9e5c0) *x UNOP (0x8aa3368) null [15] SVOP (0x8aa3398) gvsv GV (0x8a9e5c0) *x $ perl -wMstrict -MO=Terse -e 'my $x; $x = chomp $x;' LISTOP (0x92913d8) leave [1] OP (0x9291754) enter COP (0x92913fc) nextstate OP (0x9291434) padsv [1] COP (0x929171c) nextstate UNOP (0x9291778) schomp [1] UNOP (0x9291368) null [149] OP (0x92913a0) padsv [1]