From d43ef34abc56cec87d288d90cac1c791bc4676a5 Mon Sep 17 00:00:00 2001 From: Matthew Slowe Date: Sat, 2 Sep 2023 14:54:39 +0100 Subject: [PATCH] Dereference record --- manage-dns.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manage-dns.pl b/manage-dns.pl index 57c7719..cfe3528 100755 --- a/manage-dns.pl +++ b/manage-dns.pl @@ -297,10 +297,10 @@ unless($DRY_RUN) { # Create foreach my $record (@to_create) { my $res = $ua->post( - $record[0], + $record->[0], "Content-Type" => "application/json", Content => to_json({ - records => [ $record[1] ] + records => [ $record->[1] ] }) ); warn "Failed to create $url: " . $res->status_line . "\n" . $res->content unless $res->is_success; @@ -309,9 +309,9 @@ unless($DRY_RUN) { # Update foreach my $record (@to_update) { my $res = $ua->put( - $record[0], + $record->[0], "Content-Type" => "application/json", - "Content" => to_json({ records => [ $record[1] ] }), + "Content" => to_json({ records => [ $record->[1] ] }), ); warn "Failed to update $url: " . $res->status_line unless $res->is_success; }