$datapath = "/Users/code/data"; my @allfiles = <$datapath/*.*>; foreach $item (@allfiles) { parsing... }