in reply to creating a file using a variable name
The syntax seems all right. Try and print an error message, maybe it's something as silly as permissions.
open(NEWFILE, ">$filename") or die "Error: $!" [download]
--bwana147