Umm, maybe I'm not following you correctly here, but it looks like you have a bit of a mish-mosh. Relative paths (like those starting with "..") start from your current directory. To do what you're looking for, you need to change your directory first. Something like this should work:
chdir "/home/main/sub/oldfiles"; # or wherever
open READ, "$file" # open READ ">$file" is a typo, no?
or die "Couldn't open $file to read: $!\n";
# ... Do stuff, ready to write
open WRITE1, "> ../newfiles/$file"
or die "Couldn't open $file to write: $!\n";
# ..Whatever...
open WRITE2, ">../../cgi-bin/$file"
or die "Couldn't open $file to write: $!\n";
This works fine on an HP-UX box, using 5.005_02.
Did I answer the right question?
HTH