Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Odd behaviour of chomp()

by dave_the_m (Monsignor)
on Oct 20, 2015 at 10:58 UTC ( [id://1145408]=note: print w/replies, xml ) Need Help??


in reply to Odd behaviour of chomp()

It's a bug that's been fixed in 5.22.0.

From perl5220delta.pod:

Assignment to a lexical scalar is often optimised away; for example in C<my $x; $x = $y + $z>, the assign operator is optimised away and the +add operator writes its result directly to C<$x>. Various bugs related to this optimisation have been fixed. Certain operators on the right-han +d side would sometimes fail to assign the value at all or assign the wro +ng value, or would call STORE twice or not at all on tied variables. The operators affected were C<$foo++>, C<$foo-->, and C<-$foo> under C<use integer>, C<chomp>, C<chr> and C<setpgrp>.

Dave.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-04-19 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found