Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How many bugs can *you* find

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


in reply to How many bugs can *you* find

Let's see...
1) Using global variables like $htmlDir.
2) Hardcoding the filename tile.htm (This both reduces the capability of the function as well as allowing someone to figure out what file needs messing with.)
3) The foreach loop should be foreach my $section (@sections) to avoid clobbering $section in the surrounding scope.
4) Just to be nitpicky, but it should be elsif ($section eq 'Link')
5) $contentTemp =~ s/[\n\r]/<p>/g; will give different behavior whether on Win32 or Unix. This would be better as s/\n\r?/<p>/g; instead. In addition, doesn't Mac have a different carriage return sequence, too?


Comment on Re: How many bugs can *you* find
Select or Download Code
Re: Re: How many bugs can *you* find
by MeowChow (Vicar) on May 01, 2001 at 01:45 UTC
    A nitpick on your nitpicks, [\n\r] is a character class, so it works correctly.
       MeowChow                                   
                   s aamecha.s a..a\u$&owag.print
      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.
        To nitpick further doing s///'ing \n and \r separatly is faster using a char class.

        Greetz
        Beatnik
        ... Quidquid perl dictum sit, altum viditur.
        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://76767]
help
Chatterbox?
and the web crawler heard nothing...

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

    When choosing user names for websites, I prefer to use:








    Results (256 votes), past polls