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:
This works fine on an HP-UX box, using 5.005_02.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";
Did I answer the right question?
HTHIn reply to Re: opening new file in different directory
by VSarkiss
in thread opening new file in different directory
by George_Sherston
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |