Subject: | Use of uninitialized value in pattern match (m//) at Test/Builder.pm 292 |
Distribution: Test-Simple-0.47
My Perl version: 5.6.1
OS: Linux
I see that the code is testing weather $name is defined or not, but I still keep getting the above warning "diagnostics" pragma is enabled.
The line that produces the above warning is:
ok(defined($article->id) ? 0 : 1 , $article->id);
where $article->id is expected to return "undef".
I'm not sure what's wrong with the code in Test/Builder.pm (line 292), but following seems to fix it:
diff -u -r1.1.1.1 Builder.pm
--- lib/Test/Builder.pm 6 Sep 2003 23:33:51 -0000 1.1.1.1
+++ lib/Test/Builder.pm 6 Sep 2003 23:52:57 -0000
@@ -289,6 +289,7 @@
lock $Curr_Test;
$Curr_Test++;
+ $name ||= "";
$self->diag(<<ERR) if defined $name and $name =~ /^[\d\s]+$/;
You named your test '$name'. You shouldn't use numbers for your test names.
Very confusing.