diff --git a/bin/ngcp-create-domain b/bin/ngcp-create-domain index 9447b26..61ffbf0 100755 --- a/bin/ngcp-create-domain +++ b/bin/ngcp-create-domain @@ -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"; diff --git a/bin/ngcp-credit-warning b/bin/ngcp-credit-warning index f679601..6344f83 100755 --- a/bin/ngcp-credit-warning +++ b/bin/ngcp-credit-warning @@ -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( diff --git a/bin/ngcp-fraud-notifier b/bin/ngcp-fraud-notifier index a9b6b51..e57ed40 100755 --- a/bin/ngcp-fraud-notifier +++ b/bin/ngcp-fraud-notifier @@ -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};