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
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;
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
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
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
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
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