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

Re: Reading a text file collapsing line continuations

by Bloodnok (Vicar)
on Mar 09, 2009 at 16:16 UTC ( [id://749335]=note: print w/replies, xml ) Need Help??


in reply to Reading a text file collapsing line continuations

Why not accumulate the lines into an array and then chomp the array ?

A user level that continues to overstate my experience :-))
  • Comment on Re: Reading a text file collapsing line continuations

Replies are listed 'Best First'.
Re^2: Reading a text file collapsing line continuations
by CountZero (Bishop) on Mar 09, 2009 at 16:27 UTC
    If you have a really huge file, your solution needs a lot of memory.

    Furthermore you will still need to loop over all the data to re-assemble the broken lines, so your code will not be much simpler.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      Obviously, my intentions weren't as clear as they obviously could have been - my proposal was to maintain the broken line processing, merely accumulating assimilated lines into an array which ....... Oh bugger!! your point hoves quite clearly into view - just off to see if there's a cure for the write before you think malady - with which I have, self-evidently, been stricken.

      A user level that continues to overstate my experience :-))

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-29 15:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found