in reply to chomp() problems

Not quite sure why chomp isn't working, but your tr// isn't very wise as you are replacing the \r\n with 2 null (ascii 0) bytes which could bite (chomp:) back later.

I think tr/\r\n//; would probably be better.

If you posted the relevant bit of your code, it might be easier to see why chomp isn't doing what you expect.


Cor! Like yer ring! ... HALO dammit! ... 'Ave it yer way! Hal-lo, Mister la-de-da. ... Like yer ring!

Replies are listed 'Best First'.
Re: Re: chomp() problems
by mojobozo (Monk) on Sep 24, 2002 at 17:40 UTC
    Personally, if it's not working but you have a work around, I'd go with the work around, although I would agree with the above comment and not use the NULLS.
    TMTOWTDI
    _____________________________________________________
    mojobozo
    word (wûrd)
    interj. Slang. Used to express approval or an affirmative response to
    something. Sometimes used with up. Source
      OTOH, this could be a symptom of a larger problem which could surface again later, but might not be as easy to find. I suggest figuring out what it going on. Besides, having a better understanding of the code can't hurt, right? :-)

      -disciple