exact::me - Original program path locations extension for exact
version 1.05
use exact -me; say me(); # full path to $0 say me('../dir/file'); # full path based on relative dir from $0 dir say me('dir/file'); # full path found from $0 dir or in a parent of it
exact::me is an extension for exact that imports a me() function into the calling namespace.
me()
use exact -me;
The following function is imported:
This function when called without any input will return the path to the current program ($0):
$0
say me(); # full path to $0
When provided with a relative path, it will generate a full path by combining the input with a full path to the current program ($0):
say me('../dir/file'); # full path based on relative dir from $0 dir
For input that is a relative path that does not begin with ".", a relative path will be searched for at or above the directory of the program ($0). If found, that path will be returned; otherwise, undef.
undef
say me('dir/file'); # full path found from $0 dir or in a parent of it
See the exact documentation for additional information about extensions. The intended use of exact::me is via the extension interface of exact.
use exact -me, -conf, -noutf8;
However, you can also use it directly, which will also use exact with default options:
use exact::me;
You can look for additional information at:
GitHub
MetaCPAN
GitHub Actions
Codecov
CPANTS
CPAN Testers
Gryphon Shafer <gryphon@cpan.org>
This software is Copyright (c) 2020-2050 by Gryphon Shafer.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install exact::me, copy and paste the appropriate command in to your terminal.
cpanm
cpanm exact::me
CPAN shell
perl -MCPAN -e shell install exact::me
For more information on module installation, please visit the detailed CPAN module installation guide.