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($_); } }