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


in reply to Determining the directory the running script is in

How about

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