#!perl use strict; use File::Copy; opendir(DIR,'../input') or die "$!"; while (readdir DIR){ unless (/^[.]{1,2}$/){ print "copying $_\n"; copy("../input/$_","../output/$_") or die "Copy failed for $_ : $!"; } }