Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Strings overwrite themselves in print command

by AnomalousMonk (Archbishop)
on Jun 27, 2016 at 22:35 UTC ( [id://1166703]=note: print w/replies, xml ) Need Help??


in reply to Strings overwrite themselves in print command

What hippo said. It's quite easy to exemplify this effect:

c:\@Work\Perl>perl -wMstrict -le "my $overwrite = qq{AAAAA\rbbbb\rCCC\rdd\rE}; print $overwrite; " EdCbA

Update: I would say the problem is likely not so much with leading or trailing carriage returns as with embedded  \r characters as in the example.


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

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

    No recent polls found