Neither I see a chance to fix this in a sensible way. Pod::Usage already
spends considerable effort to determine the script/module location, by
searching $PATH etc. Only in the pathological case that $0 is a relative
path, and the script itself takes away the point of reference (the cwd)
there is a problem - and I do not see a robust way to do this:
1. Store the cwd in a BEGIN {} in Pod::Usage for later reference:
This can easily be broken by doing the chdir in a BEGIN block in
the script itself. And it adds significant overhead (loading Cwd
and executing cwd()) for all normal cases
2. Search the entire file system for $0
That's a no-go for enterprise sites
I can only say: Don't do it! Postpone the chdir() after (potentially)
calling pod2usage. Or restore the chdir() to the original value (which
your script must determine first) before calling pod2usage. Hope this
helps... I will add a warning in Pod::Usage doc though.
Feel free to reopen this ticket if you have some bright idea!
-Marek