C
cartercc
I know that Perl has a notion of the current directory, and that this
notion can be changed.
I wrote a script a couple of years ago that generates about a dozen
files, deleting some and moving others to various directories. Since
that time, others have modified it in various ways, unfortunately
without following through the dependencies. Late last week, the script
stopped working, and I was invited to fix it. I was able to compare
the script that I released with the current script and make it work.
In the process, I was requested to generate an additional file, to be
placed in the script directory. The script now generates the file, but
places it into another directory.
Neither
open RESULTS, ">results.txt"; nor
open RESULTS, ">./results.txt";
work, and I don't want to hard code the directory path because the
script gets moved from machine to machine and the path differs. (I use
a config file which initializes the relative paths of where to put the
files.)
The script is now 15 pages long and quite frankly I don't want to go
through it line by line -- I simply don't have the time. Any pointers
on how to fix this? Other than hard coding the absolute path? (I just
did this, and it works for now, until it's run on another server.)
Thanks, CC.
notion can be changed.
I wrote a script a couple of years ago that generates about a dozen
files, deleting some and moving others to various directories. Since
that time, others have modified it in various ways, unfortunately
without following through the dependencies. Late last week, the script
stopped working, and I was invited to fix it. I was able to compare
the script that I released with the current script and make it work.
In the process, I was requested to generate an additional file, to be
placed in the script directory. The script now generates the file, but
places it into another directory.
Neither
open RESULTS, ">results.txt"; nor
open RESULTS, ">./results.txt";
work, and I don't want to hard code the directory path because the
script gets moved from machine to machine and the path differs. (I use
a config file which initializes the relative paths of where to put the
files.)
The script is now 15 pages long and quite frankly I don't want to go
through it line by line -- I simply don't have the time. Any pointers
on how to fix this? Other than hard coding the absolute path? (I just
did this, and it works for now, until it's run on another server.)
Thanks, CC.