GrandFather already explained why your code was not doing what you thought it was.
Here's an additional solution for achieving what you want though:
use Cwd qw(abs_path); use File::Basename qw(dirname); my $dirname = dirname(__FILE__); my $db_dir_qfn = abs_path("$dirname/../db"); print "$db_dir_qfn\n";
In reply to Re: Finding files relative to a module
by wind
in thread Finding files relative to a module
by hsmyers
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |