my $path = "/very/long/path/here"; # or maybe: opendir(my $path, "/very/long/path/here"); move($abc1,"$path/compleat/"); foreach my $file (<$path/MHSAPC/*csv>){chomp; ... ## read also about glob #### $mmtime = (stat($file))[9]; if ($mmtime > 600){do something ....} ; ## note that these are seconds, 10 min = 600 sec #### if ($abc1 eq "") { next; }