in reply to File opening, based on a regex...
open (FILE, ">>$_"); [download]
while(<>) { chomp; [download]