Subject: | A typo in clean() warning |
The tests show:
t/builder-extra-dir.t .. ok
Use of uninitialized value $1 in concatenation (.) or string at /home/test/fedora/perl-Test-Directory/Test-Directory-0.051/blib/lib/Test/Directory.pm line 128.
test-directory-tmp-gRcbe: at t/builder.t line 54.
Attached patch fixes the warning about an uninitialized value.
Subject: | Test-Directory-0.051-Fix-a-typo-in-clean-warning.patch |
From 5d2a74bbbd12043880d0fab552e104d8ec9e3bd1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Wed, 25 Sep 2019 11:55:56 +0200
Subject: [PATCH] Fix a typo in clean() warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The tests show:
t/builder-extra-dir.t .. ok
Use of uninitialized value $1 in concatenation (.) or string at /home/test/fedora/perl-Test-Directory/Test-Directory-0.051/blib/lib/Test/Directory.pm line 128.
test-directory-tmp-gRcbe: at t/builder.t line 54.
This is because a typo in clean() method. A failed rmdir function sets
$! variable, but a croak call interpolates $1 variable that is usually
undefined at that time.
This patch fixes it.
Signed-off-by: Petr PÃsaÅ <ppisar@redhat.com>
---
lib/Test/Directory.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/Test/Directory.pm b/lib/Test/Directory.pm
index a6e6339..dddf250 100644
--- a/lib/Test/Directory.pm
+++ b/lib/Test/Directory.pm
@@ -127,7 +127,7 @@ sub clean {
rmdir $self->path($dir);
};
my $rv = rmdir $self->{dir};
- carp "$self->{dir}: $1" unless $rv;
+ carp "$self->{dir}: $!" unless $rv;
return $rv;
}
--
2.21.0