use Config::File 'config'; %hash = config( file => $file, path => $path ); print $hash{key};