Perl has two pseudo-constants describing the current location in
your source code, __FILE__ and __LINE__. The Perl 5 module Dir::Self
adds __DIR__, which expands to the directory your source file is
in, as an absolute pathname.

Homepage:
https://metacpan.org/release/Dir-Self
