Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Replace new line with white space

by wind (Priest)
on Mar 09, 2014 at 21:45 UTC ( #1077623=note: print w/replies, xml ) Need Help??


in reply to Replace new line with white space

I suspect that what you really need is chomp, and that you don't need a regex at all.
while (<$fh>) { chomp; # Line in $_ no longer has trailing \n
However, without seeing your code we can't confidently advise you either way.

Replies are listed 'Best First'.
Re^2: Replace new line with white space
by fattahsafa (Sexton) on Mar 10, 2014 at 21:21 UTC
    Thanks for responding. But chomp only trims the new line at the end of the string.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2022-11-26 23:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?