I have my test files in a directory "t", e.g. the file ..../t/mytest.t. In mytest.t I want to open a file by using a relative path. If I want that make test is successful, I have to use a relative path like this ./t/data/test.txt. But if would call e.g. perl mytest.t it would fail, because the relative path should be ./data/test.txt.
Is there an elegant way to open a file with a relative path independent if I call it from the "t" directory or its parent directory?
Thank you!
In reply to Relative path in test file by Dirk80
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |