foreach my $f ( map { "$dirtoget/$_" } @thefiles ) { ... }