$x =~ /^(\S+)$f\t\(?([^\t]+?)\)?(:?$f){0,2}$/ or next;
$aliases{$1} = [ split_addrs($2) ];
}},
+ elm => sub { my $fh = shift;
+ while (<$fh>) {
+ if (/^(\S+)\s+=\s+[^=]+=\s(\S+)/) {
+ my ($alias, $addr) = ($1, $2);
+ $aliases{$alias} = [ split_addrs($addr) ];
+ }
+ } },
+
gnus => sub { my $fh = shift; while (<$fh>) {
if (/\(define-mail-alias\s+"(\S+?)"\s+"(\S+?)"\)/) {
$aliases{$1} = [ $2 ];
sub ask {
my ($prompt, %arg) = @_;
- my $valid_re = $arg{valid_re} || ""; # "" matches anything
+ my $valid_re = $arg{valid_re};
my $default = $arg{default};
my $resp;
my $i = 0;
if ($resp eq '' and defined $default) {
return $default;
}
- if ($resp =~ /$valid_re/) {
+ if (!defined $valid_re or $resp =~ /$valid_re/) {
return $resp;
}
}