Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: Re: How many bugs can *you* find

by satchboost (Scribe)
on May 01, 2001 at 02:13 UTC ( #76787=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: How many bugs can *you* find
in thread How many bugs can *you* find

To nitpick further, [\n\r] will replace every instance of \n or \r with a <p>. That means that, on Win32, you'll get two <p> and only one on Unix.


Comment on Re: Re: Re: How many bugs can *you* find
Download Code
Re: Re: Re: Re: How many bugs can *you* find
by Beatnik (Parson) on May 01, 2001 at 23:53 UTC
    To nitpick further doing s///'ing \n and \r separatly is faster using a char class.

    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.
      That may be true in general, but the idea is to take the CRLF sequence in Unix (\n) and the CRLF sequence in Windows (\n\r) and replace either of them with <p>. To do that, one regex is simpler than two.
        a character case won't solve that :)

        Greetz
        Beatnik
        ... Quidquid perl dictum sit, altum viditur.
        FYI when I am on Unix looking at files from DOS, the end of line sequence is \r\n, not \n\r.
Re: Re: Re: Re: How many bugs can *you* find
by MeowChow (Vicar) on May 02, 2001 at 02:31 UTC
    To put an end to the picking of nits, you will not get two <p>'s under Win32 because the file has not been opened binmode. This means the OS will strip the \r line terminators for you. Also, the correct order for matching in binmode is \r\n, not the other way around.
       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2014-12-28 18:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (182 votes), past polls