Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: parsing error?

by miyagawa (Chaplain)
on Dec 03, 2001 at 16:04 UTC ( [id://129069]=note: print w/replies, xml ) Need Help??


in reply to parsing error?

You should do chomp twice or do $lines[$x] =~ tr/\r\n//d

--
Tatsuhiko Miyagawa
miyagawa@cpan.org

Replies are listed 'Best First'.
Re: Re: parsing error?
by MZSanford (Curate) on Dec 03, 2001 at 17:02 UTC
    Because chomp() looks at $/ and removes the last character only if it matches, i don't think using it twice will help. I think the tr/// code is a better idea, or you could use chomp() followed by chop().
    i had a memory leak once, and it ruined my favorite shirt.
Re: Re: parsing error?
by bagelesque (Initiate) on Dec 03, 2001 at 16:44 UTC
    works like a champ. can't believe i didn't think of that one. that's what i get for PERL'ing when i'm sleepy *grin*

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2024-04-18 16:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found