Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Replace new line with white space

by Kenosis (Priest)
on Mar 10, 2014 at 03:42 UTC ( #1077646=note: print w/replies, xml ) Need Help??


in reply to Re: Replace new line with white space
in thread Replace new line with white space

It's difficult to know what the OP needs, even after the OP said, "...I read text from file into string...", since the following reads text from a file into a string, but chomp--in this case--will not remove newlines from $record:

use strict; use warnings; local $/ = \1024; open my $fh, '<', 'records.txt' or die $!; while ( my $record = <$fh> ) { # process 1024-byte, fixed-length, newline-containing record } close $fh;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2021-09-17 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?