#!perl use strict; opendir(DIR,'../input') or die "$!"; while (readdir DIR){ unless (/^[.]{1,2}$/){ print "parsing $_\n"; open IN,'<','../input/'.$_ or die "Could not open $_ for input : $!"; open OUT,'>','../output/'.$_ or die "Could not open $_ for output : $!"; while (my $line = ){ # process $line print OUT $line; } close IN; close OUT; } }