At 11:46 AM 2/6/2001 -0600, Garrett Goebel wrote: >From: Dan Sugalski [mailto:[EMAIL PROTECTED]] > > > > No, you attach the magic to a value. Perl just doesn't copy > > magic when it copies data. Whether this is a good thing or > > not is up in the air. (Half the time I want it to, the other > > half I don't...) > >Is there a good discussion of magic, copying magic etc. in the core perl >documentation? Or elsewhere for that matter? Any documentation, pointers, >general tips, etc. would be greatly appreciated. Nope. >I was recently bit by overloading magic in the Class::Context generic >constructor which the following code illustrates. If you return "another" >reference to a scalar which was blessed, instead of the blessed reference, >then you loose your magic. I'm trying to keep Class::Contract (which I'm >maintaining for Damian) overload friendly... But Perl magic on my map is >labelled "there be dragons". Dragons is right. It's a dicey area, and past that most extensions handle magic values flat-out wrong. (Including most of mine, so I've no room to talk...) Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk