use File::Basename 'dirname'; use Cwd 'abs_path'; my $script_dir = abs_path(dirname($0));