The code must be exceuted in a BEGIN block before any other modules are loaded. The anonymous sub gives caller some context. Hope that helps :)BEGIN { use File::Basename; chdir((sub { return dirname((caller(0))[1]) })->()); }
In reply to Re: Finding relative path to called script
by bsdz
in thread Finding relative path to called script
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |