Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Replace new line with white space

by wind (Priest)
on Mar 09, 2014 at 21:45 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-19 19:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found