Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: I need your HELP!!

by Xxaxx (Monk)
on Apr 07, 2001 at 21:44 UTC ( [id://70749]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to I need your HELP!!

gregw is totally correct and for future reference don't ignore clive's advice.

The first program you should write is:

## open data file ## slurp in lines from data file ## foreach your way through the data ## print lines back to verify it was slurped.
The second program you should write is:
## open data file ## slurp in lines from data file ## foreach your way through the data ## parse the line into two scalars ## print the two scalars to verify parsing.
The third program you should write is:
## open data file ## slurp in lines from data file ## foreach your way through the data ## parse the line into two scalars ## stuff the two scalars into two arrays ## print the two arrays to verify stuffing.
The fourth program you should write is:
## open data file ## slurp in lines from data file ## foreach your way through the data ## parse the line into two scalars ## stuff the two scalars into two arrays ## sum all grades ## print the sum ## count the number of grades ## print the number of grades ## calculate the averate ## print the average
This is what I call sneaking up on the project -- step by step.

Later you can go back into the final program and remove unnecessary 'inbetween' variables and do general clean up.

For the moment your questions may resolve around simple things like: "How in the heck do I 'slurp' (a.k.a. read in) a file?" or such things as: "How do I step through a file line by line?"

Good luck.

Claude
p.s. Individual tastes will vary when it comes to selecting which baby steps to take in sneaking up on a program. In general you can bet that trying to do it all at once will introduce too many problems and bugs to deal with.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://70749]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.