note
MaxKlokan
For a beginner my solution is perhaps too cryptic, but I am going to give it anyway, just in case somebody finds it interesting.<br>
You can do it all with a single command if you use [doc://grep], which can be used to apply a block of statements to all elements in a list :
<code>
use File::Copy;
grep { (move("old/$_", "new/.") or warn "$_ => $!") if -f } @files;
</code>
The default variable $_ is set to each element of the list and the operator -f can work with it.<br>
$! is the error message if an error has indeed occurred.
596203
596203