see Message-Id: <
20030114220737.2190ba7c.rgarciasuarez@free.fr>
plus a test case by B. Goldberg
p4raw-id: //depot/perl@18486
$| = 1;
}
-print "1..94\n";
+print "1..98\n";
$a = {};
bless $a, "Bob";
main::test can( "Pickup", "can" ) == \&UNIVERSAL::can;
main::test VERSION "UNIVERSAL" ;
}
+
+{
+ # test isa() and can() on magic variables
+ "Human" =~ /(.*)/;
+ test $1->isa("Human");
+ test $1->can("eat");
+ package HumanTie;
+ sub TIESCALAR { bless {} }
+ sub FETCH { "Human" }
+ tie my($x), "HumanTie";
+ ::test $x->isa("Human");
+ ::test $x->can("eat");
+}
if (SvGMAGICAL(sv))
mg_get(sv);
- if (!SvOK(sv) || !(SvROK(sv) || (SvPOK(sv) && SvCUR(sv))))
+ if (!SvOK(sv) || !(SvROK(sv) || (SvPOK(sv) && SvCUR(sv))
+ || (SvGMAGICAL(sv) && SvPOKp(sv) && SvCUR(sv))))
XSRETURN_UNDEF;
name = (char *)SvPV(ST(1),n_a);
if (SvGMAGICAL(sv))
mg_get(sv);
- if (!SvOK(sv) || !(SvROK(sv) || (SvPOK(sv) && SvCUR(sv))))
+ if (!SvOK(sv) || !(SvROK(sv) || (SvPOK(sv) && SvCUR(sv))
+ || (SvGMAGICAL(sv) && SvPOKp(sv) && SvCUR(sv))))
XSRETURN_UNDEF;
name = (char *)SvPV(ST(1),n_a);