my %defaults = ( 'other1' => 'default1', 'other2' => 'default2' ); my %from_cmdline = process_command_line(); my $config = $from_cmdline{config} || "default.config"; my %from_config = read_config_file($config); my %opts = (%defaults, %from_config, %from_cmdline);