And correct the wrong chunk of doc that had slipped in when the wizard validation cleanup happened.
sig = vmg_wizard_sig(wiz);
data = vmg_data_get(SvRV(sv), sig);
if (!data)
sig = vmg_wizard_sig(wiz);
data = vmg_data_get(SvRV(sv), sig);
if (!data)
ST(0) = data;
XSRETURN(1);
ST(0) = data;
XSRETURN(1);
getdata [$@%&*]var, [$wiz|$sig]
This accessor fetches the private data associated with the magic C<$wiz> (or the signature C<$sig>) in the variable.
getdata [$@%&*]var, [$wiz|$sig]
This accessor fetches the private data associated with the magic C<$wiz> (or the signature C<$sig>) in the variable.
-It croaks when C<$wiz> or C<$sig> do not represent a current valid magic object attached to the variable, and returns C<undef> when the wizard has no data constructor or when the data is actually C<undef>.
+It croaks when C<$wiz> or C<$sig> do not represent a valid magic object, and returns an empty list if no such magic is attached to the variable or when the wizard has no data constructor.
# Get the attached data, or undef if the wizard does not attach any.
my $data = getdata $x, $wiz;
# Get the attached data, or undef if the wizard does not attach any.
my $data = getdata $x, $wiz;
is($@, '', 'cast non-data wizard doesn\'t croak');
ok($res, 'cast non-data wizard returns true');
is($@, '', 'cast non-data wizard doesn\'t croak');
ok($res, 'cast non-data wizard returns true');
-$data = eval { getdata $a, $wiz };
-is($@, '', 'getdata from non-data wizard doesn\'t croak');
-is($data, undef, 'getdata from non-data wizard invalid returns undef');
+my @data = eval { getdata $a, $wiz };
+is($@, '', 'getdata from non-data wizard doesn\'t croak');
+is_deeply(\@data, [ ], 'getdata from non-data wizard invalid returns undef');
$wiz = wizard data => sub { ++$_[1] };
my ($di, $ei) = (1, 10);
$wiz = wizard data => sub { ++$_[1] };
my ($di, $ei) = (1, 10);