in reply to From a Blessing to a Curse
If others want to use this in their own Perl programs now, they could use Inline:
use Inline C => <<EOF; int curse( SV *obj ) { if (SvOBJECT(SvRV(obj))) { SvOBJECT_off(SvRV(obj)); SvSTASH(SvRV(obj)) = NULL; return 1; } return 0; } EOF my $a = bless {}, 'A'; print ref($a), "\n"; curse($a); print ref($a), "\n";
update: added clarification and congrats
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: From a Blessing to a Curse
by japhy (Canon) on Jul 15, 2001 at 02:02 UTC |