This is more of a conceptual question, so it probably needs to be moved (such is my luck), but here goes:
So, I'm at work right (
all the good stories start out this way... stop me if you've heard this before) when my supervisor says, "
Hey, <insert division name here> has this really cool database verification script that checks the lines of a pipe delimited file for accuracy / formatting, and if each line passes, puts it into the database, and if it fails,
emails the owner of the particular line of the file. Here is the script, can you figure it out, and get one like it running by next week for our database?"
<insert foot into mouth>
Uh... (fearing job security)
Sure!</insert foot into mouth>
So, now I'm pouring through this 1200 line perl script with another 1200 lines of
sql scripting standing behind it going, "Uh...
damn... shouldnt have said that."
My question for the monks around here is this:
I have figured out other's code before, but never on this
scale before. I have begun to write / draw the UML diagram for this (I think this is UML, at least, but if not, its the diagram that has conditional statements in the diamonds, with lines to show program flow...) and have gone through pages. (Yea, I can hear you already, use a program that does the UML diagram for you... but I
want to draw it... :)
So, does anyone have any tips on figuring out
large blocks of uncommented code? <
shiver>
I see a lot of stuff that I know about, and many things that I can figure out (like perl's database access routines), and a few things that I have no clue on (like this:
$pipecount = tr/|//;). I have only known perl for like 5 months, and havent had too much time to devote to it for pleasureful programming. I have the camel, but what are good ways to go about this (by next week?)
thanks!
E-Bitch
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.