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

Re^3: Iterator to parse multiline string with \\n terminator

by jwkrahn (Monsignor)
on Oct 06, 2013 at 21:41 UTC ( #1057196=note: print w/replies, xml ) Need Help??


in reply to Re^2: Iterator to parse multiline string with \\n terminator
in thread Iterator to parse multiline string with \\n terminator

next goes back to:

while ( <$fh> ) {

And therefore reads the next line into $_ while redo goes back to the line after that leaving $_ unchanged.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1057196]
help
Chatterbox?
[Corion]: Nicholas Clark++ # read for a multichar block-delimiter by scanning for the last char, and only then check whether the whole delimiter was read.
[Corion]: At least if you're appending the data read to a larger buffer, this means you avoid the situation of "a delimiter was found but the other half has not been read yet"
choroba misses the context
[Corion]: choroba: Optimizing how Perl reads source code on startup (and then processes it line-by-line)

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (14)
As of 2016-12-06 14:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (107 votes). Check out past polls.