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

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

Thread Previous
From:
Stas Bekman
Date:
December 26, 2004 13:56
Subject:
Re: how to add more than one user magic of the same type with perl5.6.x
Message ID:
41CF3389.80505@stason.org
Yitzchak Scott-Thoennes wrote:
> 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;

Joe Schaefer suggests that under 5.6.x sv_magic should work with more than 
one magic of the same time. I've assumed that since one needs to use 
sv_magicext to get this functionality, I've a trouble with 5.6.x. I'm 
going to play with it now and report how did it go.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Thread Previous


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