detypo
[p5sagit/p5-mst-13.2.git] / t / pragma / strict-refs
index 6d36ff8..10599b0 100644 (file)
@@ -11,6 +11,8 @@ $c = @{"def"} ;
 $c = %{"def"} ;
 $c = *{"def"} ;
 $c = \&{"def"} ;
+$c = def->[0];
+$c = def->{xyz};
 EXPECT
 
 ########
@@ -72,6 +74,20 @@ EXPECT
 Can't use an undefined value as a symbol reference at - line 5.
 ########
 
+# strict refs - error
+use strict 'refs' ;
+my $a = fred->[0] ;
+EXPECT
+Can't use bareword ("fred") as an ARRAY ref while "strict refs" in use at - line 4.
+########
+
+# strict refs - error
+use strict 'refs' ;
+my $a = fred->{barney} ;
+EXPECT
+Can't use bareword ("fred") as a HASH ref while "strict refs" in use at - line 4.
+########
+
 # strict refs - no error
 use strict ;
 no strict 'refs' ;
@@ -180,6 +196,7 @@ ${"Fred"} ;
 require "./abc";
 EXPECT
 Can't use string ("Fred") as a SCALAR ref while "strict refs" in use at ./abc line 2.
+Compilation failed in require at - line 2.
 ########
 
 --FILE-- abc.pm
@@ -191,6 +208,7 @@ my $a = ${"Fred"} ;
 use abc;
 EXPECT
 Can't use string ("Fred") as a SCALAR ref while "strict refs" in use at abc.pm line 2.
+Compilation failed in require at - line 2.
 BEGIN failed--compilation aborted at - line 2.
 ########