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';
82 tie my @foo, 'Tie::StdArray';
89 # [perl #17753] segfault when undef'ing unquoted string constant
91 like $@, qr/^Can't modify constant item/;
95 # undefing a hash may free objects with destructors that then try to
96 # modify the hash. To them, the hash should appear empty.
99 key1 => bless({}, 'X'),
100 key2 => bless({}, 'X'),
104 is scalar keys %hash, 0;
105 is scalar values %hash, 0;
108 is delete $hash{'key2'}, undef;
111 # this will segfault if it fails
113 sub PVBM () { 'foo' }
114 { my $dummy = index 'foo', PVBM }