use File::Basename qw(dirname); use Cwd qw(abs_path); my $THIS_DIR; BEGIN { $THIS_DIR = dirname abs_path __FILE__; }