From 7d527de7af51d110c5e30bc03b7ee304ba95b0a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Rivera?= Date: Thu, 2 May 2019 16:30:34 +0200 Subject: [PATCH] perlcritic: Don't use while with implicit assignment to status --- lib/mm_network.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/mm_network.pm b/lib/mm_network.pm index b0c052313ba6..c4ac6115c5f2 100644 --- a/lib/mm_network.pm +++ b/lib/mm_network.pm @@ -27,12 +27,12 @@ sub configure_hostname { sub get_host_resolv_conf { my %conf; open(my $fh, '<', "/etc/resolv.conf"); - while (<$fh>) { - if (/^nameserver\s+([0-9.]+)\s*$/) { + while (my $line = <$fh>) { + if ($line =~ /^nameserver\s+([0-9.]+)\s*$/) { $conf{nameserver} //= []; push @{$conf{nameserver}}, $1; } - if (/search\s+(.+)\s*$/) { + if ($line =~ /search\s+(.+)\s*$/) { $conf{search} = $1; } }