in reply to Opening Text Files

What if you read the directory to get the actual filename? After parsing a file you could then move it to a different directory or delete it so that the next day the file that arrived would be the only one. I'm envisioning something like this:
opendir DIR, "/path/to/mlb/incomingdir" || die "Open dir\n"; @filelist=readdir(DIR); closedir DIR; ## @filelist has all the files and directories in the given ## directory. You'll want to screen it to make sure you're ## opening a file. foreach (@filelist) { if (-f) { &parse_scorefile($_); &move_file_to_archive($_); } }
You can actually compact this, doing the file check at the same time as the readdir, but I separated for clarity's sake. You'll of course want to strictify this.