|Just another Perl shrine|
Re: Correct pathway to a fileby johngg (Abbot)
|on Jan 10, 2013 at 14:12 UTC||Need Help??|
Prepend your directory name to the filename so as to give the path to the file, in your case an absolute path so it wouldn't matter where your script was. If you are using a relative path for your directory then that must be the path to the directory from where your script is running or you must do a chdir in your script to the place from where that relative path would succeed.
Here is a trivial example.
This script, run from the parent directory of "test"
Gives this output
I hope this is helpful.