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

Re: Look ahead and join if the line begins with a +

by Maclir (Curate)
on Apr 11, 2002 at 15:06 UTC ( #158334=note: print w/ replies, xml ) Need Help??


in reply to Look ahead and join if the line begins with a +

Some good solutions presented here - but - experience shows that the area of greatest difficulty in designing working algorithms is in dealing with "edge conditions".

Ask yourself - those who proposed things like

line[-1]
What happens if the first line of the file starts with a continuation character? Sure, this is logically an invalid case, but . . .


Comment on Re: Look ahead and join if the line begins with a +
Download Code
Re: Re: Look ahead and join if the line begins with a +
by japhy (Canon) on Apr 11, 2002 at 19:31 UTC
    My three examples protect against that, by the way.

    _____________________________________________________
    Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a (from-home) job
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2014-08-30 11:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls