If this is your first encounter with the Perl scripting language, my suggestion would be for you to take a look at some of the Perl books for beginners. At the very least take a look around the
www.perldoc.com site. There you should be able to learn the basics (and later the extra stuff) of the language you are attempting to use. I learnt Perl over one weekend the first time I had to use it for a consulting project.
Alright, enough of the preaching.. onto the question at hand. It would be much helpful if you provided us with some sample input data. I'm still not sure how it looks to begin with.
As for the code you've submitted here, it's not quite valid Perl. For example, this
$num / $tnum = $div;
will simply not work. What are you trying to do here? If my assumption is correct and you are trying to simply store the result of deviding
$num by
$tnum in the
$div variable, then you'll have put this line as follows:
$div = $num / $tnum;
Also, some of your lines are missing the ';'..
_____________________
# Under Construction
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.