use File::Basename; my $current_package = __PACKAGE__; my $path_to_module = dirname($INC{"$current_package.pm"}); my $path_to_yaml = $path_to_module; $path_to_yaml =~ s{modules}{yaml}; my $yaml_config = LoadFile($path_to_yaml.'/file_i_want_to_load.yaml');