10 no warnings 'experimental::refaliasing';
11 use vars qw($data $array $values $hash $errpat);
18 # Checking for a comma after the line number ensures that we are using
19 # yyerror for the error, rather than croak. yyerror is preferable for
20 # compile-time errors.
22 qr/Experimental $_[0] on scalar is now forbidden .* line 1,/;
30 'Errors: keys undef throws error'
36 'Errors: keys $undef throws error'
39 is($empty, undef, 'keys $undef does not vivify $undef');
42 like($@, qr/Type of arg 1 to keys must be hash/,
43 'Errors: keys CONSTANT throws error'
48 'Errors: keys qr/foo/ throws error'
51 eval q"keys $hash qw/fo bar/";
53 'Errors: keys $hash, @stuff throws error'
54 ) or print "# Got: $@";
61 'Errors: values undef throws error'
65 eval q"values $empty";
67 'Errors: values $undef throws error'
70 is($empty, undef, 'values $undef does not vivify $undef');
73 like($@, qr/Type of arg 1 to values must be hash/,
74 'Errors: values CONSTANT throws error'
77 eval "values qr/foo/";
79 'Errors: values qr/foo/ throws error'
82 eval q"values $hash qw/fo bar/";
84 'Errors: values $hash, @stuff throws error'
85 ) or print "# Got: $@";
92 'Errors: each undef throws error'
98 'Errors: each $undef throws error'
101 is($empty, undef, 'each $undef does not vivify $undef');
104 like($@, qr/Type of arg 1 to each must be hash/,
105 'Errors: each CONSTANT throws error'
110 'Errors: each qr/foo/ throws error'
113 eval q"each $hash qw/foo bar/";
115 'Errors: each $hash, @stuff throws error'
116 ) or print "# Got: $@";