http://www.perlmonks.org?node_id=905147


in reply to Finding files relative to a module

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";