Re: Magic [Slightly Off-Topic... please point me to documentation]

2001-02-07 Thread Bart Lateur
On Tue, 6 Feb 2001 17:53:17 -0200, Branden wrote: >It appears you're blessing one reference and returning another... like > >sub new { >my $key; >my $a = \$key; >my $b = \$key; >bless $a; >return $b; >} > >I think the problem is not with the overloa

Re: Magic [Slightly Off-Topic... please point me to documentation]

2001-02-06 Thread Branden
Garrett Goebel wrote: > > > package bar; > > > @ISA = qw(foo); > > > sub new { bless \my $key; \$key } > > It appears you're blessing one reference and returning another... like sub new { my $key; my $a = \$key; my $b = \$key; bless $a; return $b;

Re: Magic [Slightly Off-Topic... please point me to documentation ]

2001-02-06 Thread Simon Cozens
On Tue, Feb 06, 2001 at 01:38:56PM -0600, Garrett Goebel wrote: > I'm sorry... I didn't mean to start an off-topic thread. This is currently being discussed on p5p, so you might want to take it over there. > Is there really no substantial documentation anywhere on magic? Not yet. This looks li

RE: Magic [Slightly Off-Topic... please point me to documentation]

2001-02-06 Thread Garrett Goebel
From: Branden [mailto:[EMAIL PROTECTED]] > > try to define a method in package bar and try to call it > from $bar, like $bar->foo. Won't work either, you have > to ${$bar}->foo. Overloading should loose the magic > in the same sense that the method should not be called. No, $bar->asString and $b

Re: Magic [Slightly Off-Topic... please point me to documentation]

2001-02-06 Thread Branden
Magic [Slightly Off-Topic... please point me to documentation]Garrett Goebel wrote: > 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 blesse

Re: Magic [Slightly Off-Topic... please point me to documentation]

2001-02-06 Thread Dan Sugalski
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 > > h

Magic [Slightly Off-Topic... please point me to documentation]

2001-02-06 Thread Garrett Goebel
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, copyi