use Cwd qw( abs_path ); use File::Basename qw( dirname ); my $dir_of_pm = dirname(abs_path(__FILE__));