in reply to Best practices - absolute paths?
This issue is resolved by keeping a prefix directory:
Which looks annoying at first, but actually works very well (and you never ever ever have to worry about portability again).File::Spec->catfile($prefix, $relative);
The rule of thumb I follow is - construct prefix paths as early as possible, construct relative paths as convenient, and construct absolute paths as late as possible, optimizing for the most data reuse, and using very verbose variable names.
This remains pretty clean, very readable, and flexible enough for it not to stink like hard coded paths.
|
|---|