+sub genopt_alphanum {
+ local ($_) = @_;
+ if (m/^-l(\d+)$/) {
+ $randlength = $1;
+ die "length out of range $minrandlength..$maxrandlength\n"
+ unless ($minrandlength<=$randlength &&
+ $randlength<=$maxrandlength);
+ } else {
+ die "unknown alphanumeric generation option\n";
+ }
+}
+
+sub gendefaults_alphanum {
+ $randlength ||= $minrandlength;
+}
+
+sub genopts {
+ while (@ARGV && $ARGV[0] =~ m/^-/) {
+ my $arg = shift @ARGV;
+ last if $arg =~ m/^--?$/;
+ { no strict qw(refs); &{"genopt_$genmethod"}($arg); }
+ }
+ { no strict qw(refs); &{"gendefaults_$genmethod"}(); }
+}
+