Help for this page

Select Code to Download


  1. or download this
      my %opts = ( 'config' => 'default.config',
                   'other1' => 'default1',
                   'other2' => 'default2' );
      %opts = (%opts, process_command_line());
      %opts = (read_config_file($opts{config}), %opts);
    
  2. or download this
      my %defaults = ( 'other1' => 'default1',
                       'other2' => 'default2' );
    ...
      my $config = $from_cmdline{config} || "default.config";
      my %from_config = read_config_file($config);
      my %opts = (%defaults, %from_config, %from_cmdline);
    
  3. or download this
      my %defaults = ( param1 => 'default1',
                       param2 => 'default2' );
    ...
      while (my ($param, $value) = each %defaults) {
        $opt{$param} = $value unless defined $opt{$param};
      }
    
  4. or download this
      my %opts = ( param1 => 'default1',
                   param2 => 'default2' );
    ...
                 "param1=s" => \$opt{param1},
                 "param2=s" => \$opt{param2});
      read_config_file(\%opt, 'default.config') if $use_default_config;