use Cwd; # ... my $cwd = getcwd(); # ... #### use File::Basename; # another core module # ... my $script_path = ( fileparse( $0 ))[1]; # look for config file in $script_path # (update: as peckingham points out, "dirname()" is easier)