in reply to Finding relative path to called script
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]) })->()); }
|
|---|