;# getopts.pl - a better getopt.pl
;# do Getopts('a:bc'); # -a takes arg. -b & -c not. Sets opt_* as a
local($argumentative) = @_;
local(@args,$_,$first,$rest);
@args = split( / */, $argumentative );
while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
($first,$rest) = ($1,$2);
$pos = index($argumentative,$first);
if($args[$pos+1] eq ':') {
eval "\$opt_$first = \$rest;";
print STDERR
"Unknown option: $first\n";