in reply to Re: Re: Ranking/Score keeping
in thread Ranking/Score keeping

The program died when attempting to open the ranks.txt file (line 69). You should modify your code so that if the file doesn't exist (hence it is a /New File/) you create and initialize it accordingly.

Once I've entered the required input the program ends and does not print any output to the screen. It writes to the rank.txt file:

--------------------------------------- 1:244:244:andy ben:1 <> 2:244:244:cathy doug:1 <> 3:244:244:elaine fred:1 <> 4:244:244:gail harry:1 ---------------------------------------
I'm not sure where you came up with 732, it is not displayed anywhere that I can see. Just because something was coded in C++ doesn't mean that it will work correctly after you convert it to Perl. If your plan is to read in each team's data and then do calculations and write the info back out to the file, you should use logic along these lines:
if rank.txt exists { if rank.txt is not empty { read each team's info and store in an array/hash } } if user wants to add new team data { loop # once through loop gets only data for one team get* team number get* member names get* team scores/whatever append record to rank.txt endloop # * input/store to array/hash } perform calculations for array/hash print results
More observations: --Jim