This shoudl show you: it's in the package that AUTOLOAD is defined in.
#!/bin/perl -w use strict; my $obj= foo->new; $obj->toto(); foo::toto(); toto(); # dies an horrible death! package foo; use vars qw($AUTOLOAD); sub new { return bless {}; } sub AUTOLOAD { my $name = $AUTOLOAD; $name =~ s/^.*:://; no strict 'refs'; *$name = sub { print "in $name\n"; }; goto &$name; }
In reply to Re: oop - obvious AUTOLOAD question
by mirod
in thread oop - obvious AUTOLOAD question
by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |