my %options=();
getopts("p:a:r:", \%options);
# test for the existence of the options on the command line.
# in a normal program you'd do more than just print these.
print "-p $options{p}\n" if defined $options{p};
print "-a $options{a}\n" if defined $options{a};
print "-r $options{r}\n" if defined $options{r};
getopts("p:a:r:", \%options);
# test for the existence of the options on the command line.
# in a normal program you'd do more than just print these.
print "-p $options{p}\n" if defined $options{p};
print "-a $options{a}\n" if defined $options{a};
print "-r $options{r}\n" if defined $options{r};