11 use vars qw(@ary %ary %hash);
42 ok defined($ary{'foo'});
43 ok !defined($ary{'bar'});
45 ok !defined($ary{'foo'});
67 like $@, qr/^Modification of a read/;
70 like $@, qr/^Modification of a read/;
74 tie my %foo, 'Tie::StdHash';
75 no warnings 'deprecated';
83 tie my @foo, 'Tie::StdArray';
84 no warnings 'deprecated';
91 # [perl #17753] segfault when undef'ing unquoted string constant
93 like $@, qr/^Can't modify constant item/;
97 # undefing a hash may free objects with destructors that then try to
98 # modify the hash. To them, the hash should appear empty.
101 key1 => bless({}, 'X'),
102 key2 => bless({}, 'X'),
106 is scalar keys %hash, 0;
107 is scalar values %hash, 0;
110 is delete $hash{'key2'}, undef;
113 # this will segfault if it fails
115 sub PVBM () { 'foo' }
116 { my $dummy = index 'foo', PVBM }