use File::Copy; open (FILE, "d:/temp/result.txt"); while () { copy($_, "d:/temp/Testordner/")or (print "File cannot be moved: " and print $_); } close (FILE);