Seriously, I don't see how reiterating your topmost problem is going to help you with the problem at hand. I get the feeling that you want a complete program to be written by us for you.
This site is not a program writing service. This site is about learning and about using Perl.
You have not displayed any effort or progress but only have rephrased your problem based upon code lines taken from replies by others. This will neither help you with your homework in the short term nor in the long run.
You will have to acquire some problem solving skills. Problem solving can be based on five simple steps:
- Identify the current problem and the causes leading to the problem.
- If the problem can be immediately solved, solve the problem.
- If the problem cannot be solved, identify the smaller problems that make up the current problem.
- Solve each small problem.
- Assemble the solutions to the small problems into a solution solving the current problem.
Until you have the ability to take a step back and identify the problem and the exact causes, it makes no sense to proceed to the later steps in the process.
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.