Integrate with mainperl.
[p5sagit/p5-mst-13.2.git] / t / pragma / strict-refs
index 6d36ff8..7bf1556 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' ;