diff options
author | Tony Cook <tony@develop-help.com> | 2020-05-27 10:41:32 +1000 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-08-10 22:33:10 -0600 |
commit | 1ad5a39ccaca372a3b35f5a76e16aa2aacab104a (patch) | |
tree | 4d371a3ec4b024192afe2119ba9e5b712b384413 /t/lib/feature | |
parent | d410bf072ab36a21fd6ad66e99bdf6f24ae54ef6 (diff) | |
download | perl-1ad5a39ccaca372a3b35f5a76e16aa2aacab104a.tar.gz |
add a default enabled feature "multidimensional"
Like "indirect" this feature is enabled by default and enables the
perl4 hash-based multidimensional array emulation documented under
$; in perlvar.
Diffstat (limited to 't/lib/feature')
-rw-r--r-- | t/lib/feature/multidimensional | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/t/lib/feature/multidimensional b/t/lib/feature/multidimensional new file mode 100644 index 0000000000..a39baaeec6 --- /dev/null +++ b/t/lib/feature/multidimensional @@ -0,0 +1,22 @@ +Test no feature multidimensional + +__END__ +# NAME simple +my $x = "a"; +my $y = "b"; +my %foo; +$foo{$x, $y} = "c"; +$foo{$y} = "d"; +print $foo{$x, $y}, "\n"; +no feature "multidimensional"; +print $foo{$x, $y}, "\n"; +$foo{$x, $y} = "e"; +print $foo{$y}, "\n"; +use feature "multidimensional"; +print $foo{$x, $y}, "\n"; +$foo{$x, $y} = "e"; +EXPECT +OPTIONS fatal +Multidimensional hash lookup is disabled at - line 8, near "$y}" +Multidimensional hash lookup is disabled at - line 9, near "$y}" +BEGIN not safe after errors--compilation aborted at - line 11. |