Help for this page

Select Code to Download


  1. or download this
    GetOptions(
        '--one'   => \$one,
    ...
    
    die "Only one of options --one, --two and --three are allowed\n"
       if ( grep defined, $one, $two, $three ) > 1;
    
  2. or download this
    GetOptions(
        '--one'   => \$opts{one},
    ...
    
    die "Only one of options @{[ sort keys %opts ]} are allowed\n"
       if ( grep defined, values(%opts) ) > 1;