# Calculate the length of a segment by taking the square root of the # differences of the squares of the sum of the x and y coordinates sub segment_length { my ($p1, $p2) = @_; sqrt(($p1->{x} + $p2->{x})**2 - ($p1->{y} + $p2->{y})**2) }
Bug 715: segment_length doesn't calculate the length of segments correctly. Bug 715 closed by holli: Not a bug, subroutine work as I documented it.
# Return a random integer 1 .. 6 to simulate a die roll. # Seed the random number generator with the current time before calcul +ating. sub roll { srand(time); 1 + int rand 6; }
Bug 4519: Due to a seeding the random number generator each time, 'roll' isn't producing random results. Bug 4519 closed by holli: Not a bug. I documented the fact it's seeding the random number generator each time.
# CSS file span.important {color: green} # Green stands out!
Bug 20123: important text should be red. Bug 20123 closed by holli: Not a bug, I documented it to be green.
my $code = $cgi->param("sql_query"); $dbh->do($code); # This is dangerous.
Bug 40385: All the tables have been dropped!. Bug 40385 closed by holli: I documented that it is dangerous, so it's not a bug.

But I guess they are all edge cases as well?


In reply to Re^8: An Introduction to Literate Programming with perlWEB by JavaFan
in thread An Introduction to Literate Programming with perlWEB by adamcrussell

Title:
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, details, 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, summary, 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.