[tck PATCH v2 12/13] lib: don't re-assign $_

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Perl has started to forbid code from declaring "my $_", because $_ is
implicitly always a local scope. Rewrite the code to avoid tickling this
warning.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 lib/Sys/Virt/TCK/Hooks.pm | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/Sys/Virt/TCK/Hooks.pm b/lib/Sys/Virt/TCK/Hooks.pm
index e7a8f76..7d35072 100644
--- a/lib/Sys/Virt/TCK/Hooks.pm
+++ b/lib/Sys/Virt/TCK/Hooks.pm
@@ -71,11 +71,10 @@ sub expect_result {
 sub libvirtd_status {
     my $self = shift;
     my $status = `service libvirtd status`;
-    my $_ = $status;
 
-    if (/stopped|unused|inactive/) {
+    if ($status =~ /stopped|unused|inactive/) {
         $self->{libvirtd_status} = 'stopped';
-    } elsif (/running|active/) {
+    } elsif ($status =~ /running|active/) {
         $self->{libvirtd_status} = 'running';
     }
 
-- 
2.17.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux