Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^2: Chomp doesn't work

by M15U (Acolyte)
on Mar 25, 2013 at 09:22 UTC ( #1025262=note: print w/replies, xml ) Need Help??

in reply to Re: Chomp doesn't work
in thread Chomp doesn't work

I got it. It's a little embarasing : each end of line has"\r\n" at the end. So by using this replace statement it works :

$start_input =~ s/\r\n//d;

So, if you ever get something similar, think about the "\r" before the "\n".

Replies are listed 'Best First'.
Re^3: Chomp doesn't work
by daxim (Chaplain) on Mar 25, 2013 at 12:31 UTC
    Just use \R instead!
Re^3: Chomp doesn't work
by jwkrahn (Monsignor) on Mar 25, 2013 at 18:53 UTC
    $start_input =~ s/\r\n//d;

    /d is not a valid option for s///.    Perhaps you meant tr/\r\n//d?

      /d was added in 5.14.
      لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025262]
and God said, "Let Newton be!"...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2018-01-16 17:42 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (186 votes). Check out past polls.