in reply to Re: Finding module directory from within module
in thread Finding module directory from within module
->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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Finding module directory from within module
by Anonymous Monk on Jul 30, 2009 at 07:46 UTC | |
by ikegami (Patriarch) on Jul 30, 2009 at 07:47 UTC | |
by Anonymous Monk on Jul 30, 2009 at 07:50 UTC | |
by ikegami (Patriarch) on Jul 30, 2009 at 14:51 UTC |