in reply to opening new file in different directory
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?
HTH
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: opening new file in different directory
by George_Sherston (Vicar) on Oct 23, 2001 at 19:12 UTC | |
by VSarkiss (Monsignor) on Oct 23, 2001 at 19:24 UTC | |
by George_Sherston (Vicar) on Oct 23, 2001 at 19:37 UTC | |
by VSarkiss (Monsignor) on Oct 23, 2001 at 19:53 UTC |