in reply to Loading a function from another file dynamically?!
File A
package PackageName; require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw(moo); # Put function names, seperated by + spaces, # that you want to be able to use sub moo { # do stuff }
File B
use PackageName; moo();
Basically, you're creating a simple module. You'd also be able to accomplish what you want it via eval, but modules are cleaner.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Loading a function from another file dynamically?!
by Anonymous Monk on Mar 23, 2003 at 18:53 UTC |