summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/t/lib/strict/refs
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/t/lib/strict/refs')
-rw-r--r--gnu/usr.bin/perl/t/lib/strict/refs25
1 files changed, 24 insertions, 1 deletions
diff --git a/gnu/usr.bin/perl/t/lib/strict/refs b/gnu/usr.bin/perl/t/lib/strict/refs
index d9bff7cd840..e74851220e7 100644
--- a/gnu/usr.bin/perl/t/lib/strict/refs
+++ b/gnu/usr.bin/perl/t/lib/strict/refs
@@ -27,6 +27,29 @@ Can't use string ("A::Really::Big::Package::Name::T"...) as a HASH ref while "st
# strict refs - error
use strict ;
+"A::Really::Big::Package::Name::To::Use" =~ /(.*)/;
+${$1};
+EXPECT
+Can't use string ("A::Really::Big::Package::Name::T"...) as a SCALAR ref while "strict refs" in use at - line 5.
+########
+
+# strict refs - error
+use strict ;
+*{"A::Really::Big::Package::Name::To::Use"; }
+EXPECT
+Can't use string ("A::Really::Big::Package::Name::T"...) as a symbol ref while "strict refs" in use at - line 4.
+########
+
+# strict refs - error
+use strict ;
+"A::Really::Big::Package::Name::To::Use" =~ /(.*)/;
+*{$1}
+EXPECT
+Can't use string ("A::Really::Big::Package::Name::T"...) as a symbol ref while "strict refs" in use at - line 5.
+########
+
+# strict refs - error
+use strict ;
my $fred ;
my $a = ${"fred"} ;
EXPECT
@@ -308,7 +331,7 @@ Can't use string ("Fred") as a SCALAR ref while "strict refs" in use at - line 8
use strict 'refs';
/(?{${"foo"}++})/;
EXPECT
-Can't use string ("foo") as a SCALAR ref while "strict refs" in use at (re_eval 1) line 1.
+Can't use string ("foo") as a SCALAR ref while "strict refs" in use at - line 3.
########
# [perl #37886] strict 'refs' doesn't apply inside defined
use strict 'refs';