use My::Module; use File::Spec; my $path = $INC{'My/Module.pm'}; $path = File::Spec->rel2abs($path); my ($vol, $dir, $file) = File::Spec->splitpath($path); $path = File::Spec->catpath($vol, $dir, ''); $path = File::Spec->catdir($path, 'templates'); print("$path\n");