in reply to Logging module sometimes writes its file in the wrong directory

You have a bizarre idea about what "current directory" means, IMO. It does not mean "the directory the script is in", it is the directory the user is in, as in what directory is used when you type "dir" or "ls". In Perl, you can get that path by using cwd from the module Cwd.

If you want to always use the directory the script is in, in theory you should be using FindBin, but it is rubbish. Instead, look at tye's mechanism to derive the directory from $0, in FindBin is broken (RE: How do I get the full path to the script executing?). rel2abs can be found in File::Spec as a class method, or in File::Spec::Functions as a function. (Both come with Perl.)

Using File::Basename, you can then extract the directory the script is in.

  • Comment on Re: Logging module sometimes writes its file in the wrong directory