our $user;
our $priv;
our $showcomment;
+our $genmethod = 'alphanum';
sub nextarg () {
die "too few arguments\n" unless @ARGV;
return !!$row;
}
+sub gen_local_part_alphanum {
+ my $s = chr(ord('a')+goodrand(26));
+ while (length $s < $randlength) {
+ my $v = goodrand(36);
+ $s .= chr($v < 26
+ ? ord('a')+($v)
+ : ord('0')+($v-26));
+ }
+ return $s;
+}
+
sub generate_local_part () {
my $s;
for (;;) {
- $s = chr(ord('a')+goodrand(26));
- while (length $s < $randlength) {
- my $v = goodrand(36);
- $s .= chr($v < 26
- ? ord('a')+($v)
- : ord('0')+($v-26));
- }
+ { no strict qw(refs); $s = &{"gen_local_part_$genmethod"}; }
# print STDERR "$s\n";
last if !local_part_inuse($s);
}