# main script require "conf.pl"; my $conf = get_conf(); print $conf->{foo}; ... # conf.pl sub get_conf { { foo => "bar", color => "red" } } 1;