->absolute doesn't handle links, but Cwd's abs_path aka realpath does.
use Cwd qw(abs_path); use Path::Class; my $THIS_DIR = file(abs_path(__FILE__))->dir; print $THIS_DIR,"\n";
It's not very likely for module (.pm) files, but it's entirely possible for script (.pl) files.
In reply to Re^2: Finding module directory from within module
by ikegami
in thread Finding module directory from within module
by Zubinix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |