Cheers - L~R#!/usr/bin/perl -w use strict; use Getopt::Std; my %Opt; Get_Args(); sub Get_Args { my $Usage = qq{Usage: $0 [options] -h : This help message. -a : BOGUS - requires argument if used -A : BOGUS -b : BOGUS } . "\n"; getopts( 'ha:Ab' , \%Opt ) or die $Usage; die $Usage if $Opt{h}; die "You did not enter any options\n" if ! %Opt; if ( exists $opt{a} || exists $opt{A} ) { if ( ! ( exists $opt{a} && exists $opt{A} ) ) { die "You must use -a and -A together\n"; } } }
In reply to Re: Boundary conditions with Getopt::Std
by Limbic~Region
in thread Boundary conditions with Getopt::Std
by blink
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |