t/00-load.t
t/20-hash.t
t/22-hash-kv.t
+t/23-hash-tied.t
t/30-array.t
t/31-array-fast.t
t/32-array-kv.t
+t/33-array-tied.t
t/40-scope.t
t/41-padsv.t
t/42-deparse.t
defined = TRUE;
break;
default:
- defined = SvOK(sv);
+ SvGETMAGIC(sv);
+ if (SvOK(sv))
+ defined = TRUE;
}
return defined;
flags = oi.flags;
if (flags & A_HINT_DEREF) {
- if (!SvOK(TOPs)) {
+ if (!a_defined(TOPs)) {
/* We always need to push an empty array to fool the pp_aelem() that comes
* later. */
SV *av;
flags = oi.flags;
if (flags & A_HINT_DEREF) {
- if (!SvOK(TOPs))
+ if (!a_defined(TOPs))
RETURN;
} else {
PL_op->op_ppaddr = oi.old_pp;
flags = oi.flags;
if (flags & A_HINT_DEREF) {
- if (!SvOK(TOPs)) {
+ if (!a_defined(TOPs)) {
SV *hv;
POPs;
hv = sv_2mortal((SV *) newHV());
if (flags & (A_HINT_NOTIFY|A_HINT_STORE)) {
SPAGAIN;
- if (!SvOK(TOPs)) {
+ if (!a_defined(TOPs)) {
if (flags & A_HINT_STRICT)
croak("Reference vivification forbidden");
else if (flags & A_HINT_WARN)
--- /dev/null
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::More;
+
+BEGIN {
+ eval 'use Tie::Hash; scalar keys %Tie::StdHash::'
+ or plan skip_all => 'Tie::StdHash required to test tied hashes';
+ defined and diag "Using Tie::StdHash $_" for $Tie::Hash::VERSION;
+ plan tests => 1;
+}
+
+{
+ tie my %x, 'Tie::StdHash';
+ tie my %y, 'Tie::StdHash';
+
+ $x{key} = 'hlagh';
+ $y{x} = \%x;
+
+ my $res = do {
+ no autovivification;
+ $y{x}{key};
+ };
+ is $res, 'hlagh', 'nested tied hashes';
+}
--- /dev/null
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::More;
+
+BEGIN {
+ eval 'use Tie::Array; scalar keys %Tie::StdArray::'
+ or plan skip_all => 'Tie::StdArray required to test tied arrays';
+ defined and diag "Using Tie::StdArray $_" for $Tie::Array::VERSION;
+ plan tests => 1;
+}
+
+{
+ tie my @a, 'Tie::StdArray';
+ tie my @b, 'Tie::StdArray';
+
+ $a[1] = 'hlagh';
+ $b[0] = \@a;
+
+ my $res = do {
+ no autovivification;
+ $b[0][1];
+ };
+ is $res, 'hlagh', 'nested tied arrays';
+}