Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: chomp not working

by HeatSeekerCannibal (Beadle)
on Dec 07, 2007 at 17:59 UTC ( [id://655706]=note: print w/replies, xml ) Need Help??


in reply to chomp not working

Hi

If you're passing files back and forth between *nix and windows, it may be that the end-of-lines are messed up.

Have you tried dos2unix?

Best of luck!

Heatseeker Cannibal

Replies are listed 'Best First'.
Re^2: chomp not working (resolved)
by djbryson (Beadle) on Dec 07, 2007 at 20:05 UTC
    I think I know why the chomp wasn't working. chomp removes the newline character from the end of the string. My file was all 1 string... so it's only removing the last newline char, not the new line chars throughout.
    solution: $content =~ s/\r\n//g;
    Thanks guys

Log In?
Username:
Password:

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

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

    No recent polls found