in reply to Opening Text Files
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.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($_); } }
|
|---|