Hello,
I have a strange collision using bless and AUTOLOAD.
For example, here a simple Perl script, t.pl, which
demostrates my problem:
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my $t=T->new();
package T;
my $AUTOLOAD;
sub new {
my ($class, %arguments) = @_;
bless {}, $class;
}
sub AUTOLOAD {
print "why am I in AUTOLOAD?!\n";
}
Surprisingly, for me, when I run t.pl I get:
why am I in AUTOLOAD?!
So, why am I executing code in AUTOLOAD?
Apparently the $class is to blame in the bless statement,
but I don't know why and I don't know how to avoid this.
Anyone?
--
Shlomo Yona
[EMAIL PROTECTED]
http://yeda.cs.technion.ac.il/~yona/
_______________________________________________
Perl mailing list
[email protected]
http://perl.org.il/mailman/listinfo/perl