Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

New business idea: post code samples and try to get merlyn to offer free code reviews. Sell code reviews to clients...

merlyn wrote:

See what you can get for $10 of my time? How many of those would you have found for $10 of your time? {grin}

Rather than list what I found, I'll list what I didn't. Then everyone can see what a faker I am :)

my $paramTemp,$contentTemp; ## $contentTemp is NOT BEING DECLARED LOCAL (very misleading)

Gah! I didn't see that one. (FYI: if you don't see it, "my" binds tighter than the comma).

$content =~ s/<!--$section-->(.*)/<!--$section-->$contentTemp/; ## parens not needed on .*, what if $section has regex chars?

Saw the useless parens (and that despicable dot star!), but didn't think about $section having regex characters.

if ($image ne '') { my $newFile = fileUpload('Image',250000,1,'lat +est_image','JPEG','.jpg',' +.jpeg') } ## image might be undef if param not provided.

Sigh. I missed this one, too.

All in all, I don't feel bad about catching most of the errors. This little post was 17 lines of code. Imagine expanding this out to over 2,000!


Update: It's interesting to notice that someone can hack together a script that has virtually every line of code in error and have the script still work. The person who wrote this code was a coder, not a programmer.

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

In reply to (Ovid) Re(2): How many bugs can *you* find by Ovid
in thread How many bugs can *you* find by Ovid

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (2)
    As of 2018-05-20 18:00 GMT
    Find Nodes?
      Voting Booth?