11 use vars qw(@ary %ary %hash);
42 ok defined($ary{'foo'});
43 ok !defined($ary{'bar'});
45 ok !defined($ary{'foo'});
49 no warnings 'deprecated';
57 no warnings 'deprecated';
65 no warnings 'deprecated';
79 like $@, qr/^Modification of a read/;
82 like $@, qr/^Modification of a read/;
86 tie my %foo, 'Tie::StdHash';
87 no warnings 'deprecated';
95 tie my @foo, 'Tie::StdArray';
96 no warnings 'deprecated';
103 # [perl #17753] segfault when undef'ing unquoted string constant
105 like $@, qr/^Can't modify constant item/;
109 # undefing a hash may free objects with destructors that then try to
110 # modify the hash. To them, the hash should appear empty.
113 key1 => bless({}, 'X'),
114 key2 => bless({}, 'X'),
118 is scalar keys %hash, 0;
119 is scalar values %hash, 0;
122 is delete $hash{'key2'}, undef;
125 # this will segfault if it fails
127 sub PVBM () { 'foo' }
128 { my $dummy = index 'foo', PVBM }