Remove the "Newline in left-justified string" warning.
[p5sagit/p5-mst-13.2.git] / t / lib / warnings / pp_hot
index 7df18af..f5a5803 100644 (file)
@@ -57,6 +57,9 @@ $f = $a = "abc" ;
 print $f $a;
 no warnings 'unopened' ;
 print $f $a;
+use warnings;
+no warnings 'unopened' ;
+print $f $a;
 EXPECT
 print() on unopened filehandle abc at - line 4.
 ########
@@ -100,6 +103,9 @@ no warnings 'closed' ;
 print STDIN "anc";
 opendir STDIN, ".";
 print STDIN "anc";
+use warnings;
+no warnings 'closed' ;
+print STDIN "anc";
 EXPECT
 print() on closed filehandle STDIN at - line 4.
 print() on closed filehandle STDIN at - line 6.
@@ -115,6 +121,23 @@ print $fh "Shouldn't print anything, but shouldn't SEGV either\n";
 EXPECT
 print() on closed filehandle at - line 7.
 ########
+# pp_hot.c [pp_print]
+package foo;
+use warnings 'closed';
+open my $fh1, "nonexistent";
+print $fh1 42;
+open $fh2, "nonexistent";
+print $fh2 42;
+open $bar::fh3, "nonexistent";
+print $bar::fh3 42;
+open bar::FH4, "nonexistent";
+print bar::FH4 42;
+EXPECT
+print() on closed filehandle $fh1 at - line 5.
+print() on closed filehandle $fh2 at - line 7.
+print() on closed filehandle $fh3 at - line 9.
+print() on closed filehandle FH4 at - line 11.
+########
 # pp_hot.c [pp_rv2av]
 use warnings 'uninitialized' ;
 my $a = undef ;
@@ -122,7 +145,7 @@ my @b = @$a;
 no warnings 'uninitialized' ;
 my @c = @$a;
 EXPECT
-Use of uninitialized value in array dereference at - line 4.
+Use of uninitialized value $a in array dereference at - line 4.
 ########
 # pp_hot.c [pp_rv2hv]
 use warnings 'uninitialized' ;
@@ -131,7 +154,7 @@ my %b = %$a;
 no warnings 'uninitialized' ;
 my %c = %$a;
 EXPECT
-Use of uninitialized value in hash dereference at - line 4.
+Use of uninitialized value $a in hash dereference at - line 4.
 ########
 # pp_hot.c [pp_aassign]
 use warnings 'misc' ;
@@ -246,11 +269,11 @@ a($x . $y);       # should warn twice
 $x .= $y;      # should warn once
 $y .= $y;      # should warn once
 EXPECT
-Use of uninitialized value in concatenation (.) or string at - line 5.
-Use of uninitialized value in concatenation (.) or string at - line 6.
-Use of uninitialized value in concatenation (.) or string at - line 6.
-Use of uninitialized value in concatenation (.) or string at - line 7.
-Use of uninitialized value in concatenation (.) or string at - line 8.
+Use of uninitialized value $x in concatenation (.) or string at - line 5.
+Use of uninitialized value $y in concatenation (.) or string at - line 6.
+Use of uninitialized value $x in concatenation (.) or string at - line 6.
+Use of uninitialized value $y in concatenation (.) or string at - line 7.
+Use of uninitialized value $y in concatenation (.) or string at - line 8.
 ########
 # pp_hot.c [pp_concat]
 use warnings 'y2k';