package MY::PATH::Config.pm ...... more code ...... $configs{images}{attach} = "/path/to/image/dir/"; and later, in another module my $img = "$configs{images}{attach}" . "$att->{mime_type}" . ".gif";