Ok. Time to ask for help.
Remember me? The guy who wanted to write a program to
update goalie stats?
Well, I wrote a script that runs and essentially does
what I
want it to do, but has a couple problems. For now, Im
settling for a simple program where I input the stats
by hand and the program updates the stats and prints
the HTML for me to cut and paste to the site. This
will make it much easier for me than updating the HTML
by hand every time. since im at the most basic of
beginner levels, im sure its very simple and im just
overlooking something. if any of you could take a look
at this script and tell my why this doesnt work, id
appreciate it.
1 - when I make an update, it saves to a different
file and if you make more that one update, the
database starts making new entries rather than editing
the existing one.
2 - the HTML output is what it should look like. but i
cant figure out how to make it loop through and print
a line for each entry according to rank.
Thanks in advance.
Here is the script:
#!/usr/local/bin/perl
##
# This program checks my email box via POP3, then get
the updates
# from the emails. then run the numbers, then output
to a text file
# of the HTML that I can then cut/paste to the site.
Easy.
##
#declatations (cuz im a VB guy)
# this actually came from an email from the form.
#NewPass: new password, if they want one, if there is
nothing here, then ignore this variable
#TIME: 1011637980 This is totally irrelevent. Ignore
this
#Email: [EMAIL PROTECTED]
#InGA: 3 - this is the goals allowed in the game you
are adding to your stats
#InIR: Roller - was this a roller game, or an ice game
#Ingoalie: mike - the user name of the person updating
thier stats
#Inpass: potato - Password, must match password in
database
#Inwlt: clearMeOut - Win = A win, Loss = A loss, Tie =
a tie, clearMeOut = clear all stats for new season.
variables in DB
#GA = goals allowed
#IR = ICE or ROLLER
#Goalie = name as it appears on the website
#Password = Password
#Wlt = Win, Loss, Tie, or clear
#chapter = Which chapter of the brotherhood you are in
#username = the goalies user name
#rank = rank based on GAA. lowest GAA will be ranked 1
though highest GAA ranked whatever the highest is
#Variables in the list
#@stats = ('Goalie', 'chapter', 'GP', 'W', 'l', 'T',
'SO', 'GAA', 'GA', 'Password', 'Rank', 'Username')
#Positions = 0 1 2345
6 7 8 9 10 11
# master Db's
# %mastercombined [ ]
# %masterice [ ]
# %masterroller [ ]
# The name of the total (ice and roller) combined
database file
# $CDB = 'goaliestats.txt';
$CDB = 'goaliestatstest.txt';
# The name of the Ice database file
$IDB = 'icegoaliestats.txt';
# The name of the roller database file
$RDB = 'rollergoaliestats.txt';
##
## Open email and get info from update messages ##
##
# I will do this when I get the actual program working
###
## Get Stats From User (Becomes obsolete when email
input works ##
## see above)
##
###
### ask if they want to enter or quit.
while(1) { # Loop forever
print "\nDo you want to Enter a new stat (E), " .
" or quit and print (Q): ";
$DoSearch = ;
chomp($DoSearch);
$DoSearch =~ tr/A-Z/a-z/;
# Check if they want to quit
if($DoSearch eq 'q') { last }
# Check if they did *not* say e or E
unless($DoSearch eq 'e') {
print "You must enter either E or Q.\n";
next; # Go out to the while loop
}
### ask if the game was Ice or Roller.
print "\n(I)ce or (R)oller Game: ";
$InIR = ;
chomp($InIR);
$InIR =~ tr/A-Z/a-z/; # if uppercase, change to
lowercase
### ask what goalie.
print "\nEnter Goalie username: ";
$Ingoalie = ;
chomp($Ingoalie);
$Ingoalie =~ tr/A-Z/a-z/; # if uppercase, change to
lowercase
### ask For password
print "\nEnter Goalie Password: ";
$Inpass = ;
chomp($Inpass);
$Inpass =~ tr/A-Z/a-z/; # if uppercase, change to
lowercase
### ask Win Loss or Tie.
print "\n(W)in, (L)oss, (T)ie, or (C)lear: ";
$Inwlt = ;
chomp($Inwlt);
$inwlt =~ tr/A-Z/a-z/; # if uppercase, change to
lowercase
### ask how many Goals allowed.
print "\nGoals allowed: ";
$InGA = ;
chomp($InGA);
## Get Original Numbers from Database ##
# Open the