Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
No such thing as a small change
 
PerlMonks  

Re: Reading a text file collapsing line continuations

by Bloodnok (Vicar)
on Mar 09, 2009 at 16:16 UTC ( #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
Re^2: Reading a text file collapsing line continuations
by CountZero (Chancellor) 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
Node Status?
node history
Node Type: note [id://749335]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (15)
As of 2014-04-21 15:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (496 votes), past polls