TT#68300 Use foreach instead of map on void context

Change-Id: I1c5a79974cda2d08185e7f77f2798579dd67d451
changes/42/34742/2
Guillem Jover 6 years ago
parent a418347a07
commit dc864b2512

@ -57,7 +57,9 @@ sub main {
my $uri = '/api/domains/';
my %data = map { $_ => $opts->{$_} } qw(reseller_id domain);
map { $data{"_".$_."_reload"} = $opts->{$_} } qw(skip_xmpp skip_sip);
foreach my $elem (qw(skip_xmpp skip_sip)) {
$data{"_" . $elem . "_reload"} = $opts->{$elem};
}
my $res = $client->request("POST", $uri, \%data);
print $res->result."\n";

@ -75,10 +75,11 @@ EOF
}
my $tt = Template->new();
map { my $out;
$tt->process(\$template->{$_}, $vars, \$out);
$out and $template->{$_} = $out;
} keys %{$template};
foreach my $field (keys %{$template}) {
my $out;
$tt->process(\$template->{$field}, $vars, \$out);
$out and $template->{$field} = $out;
}
my $transport = Email::Sender::Transport::Sendmail->new;
my $email = Email::Simple->create(

@ -145,10 +145,11 @@ sub send_email {
}
my $tt = Template->new();
map { my $out;
$tt->process(\$template->{$_}, $vars, \$out);
$out and $template->{$_} = $out;
} keys %{$template};
foreach my $field (keys %{$template}) {
my $out;
$tt->process(\$template->{$field}, $vars, \$out);
$out and $template->{$field} = $out;
}
die "'To' header is empty in the email" unless $event->{interval_notify};
die "'From' header is empty in the email" unless $template->{from_email};

Loading…
Cancel
Save