Help for this page
# at top of program my @options = qw/on except some more options/; my $opt_string = join '|', @options; ... # instead of your line $curroption = $1 if s/$opt_pattern//;
while (my ($option, $val_ref) = each %options) { print "$option -- ", join (',',@$val_ref), "\n"; }