use File::Copy; grep { (move("old/$_", "new/.") or warn "$_ => $!") if -f } @files;