open (READ, ">/home/main/sub/newfiles/$file") or die "could not open /home/main/sub/newfiles/$file $!";