develooper Front page | perl.perl5.porters | Postings from December 2004

Re: how to add more than one user magic of the same type with perl 5.6.x

Thread Previous | Thread Next
From:
Yitzchak Scott-Thoennes
Date:
December 26, 2004 12:58
Subject:
Re: how to add more than one user magic of the same type with perl 5.6.x
Message ID:
20041226205814.GB756@efn.org
On Fri, Dec 24, 2004 at 07:53:02PM -0500, Stas Bekman <stas@stason.org> wrote:
> We have a situation where we need to add more than one PERL_MAGIC_ext 
> magic to an object. sv_magicext which allows to do that is available 
> starting from 5.8.x+. What do I do if I need to support 5.6.x?

I would suggest (untested):

   U32 magic_flags = SvMAGICAL(sv);
   SvMAGICAL_off(sv);
   sv_magic(sv, ...);
   SvFLAGS(sv) |= magic_flags;

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About