in reply to AUTOLOAD and packages
Hi,
No need to use AUTOLOAD here, simply use Exporter as in
package foo; use Exporter; use vars qw(@ISA @EXPORT); @ISA=qw(Exporter); @EXPORT=qw(myfunc); sub myfunc { #something clever; } package main; use foo; #imports myfunc, so that now # main::myfunc is an alias for # foo::myfunc myfunc(1,2,3); #calls foo:myfunc(1,2,3)
Autoload is usefull for other things, like automatic generation of functions.
Cheers
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: autoload and packages
by smackdab (Pilgrim) on May 11, 2002 at 20:10 UTC |