Less clutter, too:
open $file, '>', $temp . $_; [download]
In reply to Re^4: foreach loop and creating files with "$_" by toolic in thread foreach loop and creating files with "$_" by james28909