Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Replace new line with white space

by Kenosis (Priest)
on Mar 10, 2014 at 03:42 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-19 17:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found