in reply to Re: Re: Loading a function from another file dynamically?!
in thread Loading a function from another file dynamically?!
The first method loads the file into a string, then evals it.
The second method uses an external program (cat) to read the file, taking up a bit more resources.
The third method is the "preferred" way of doing it, but has a couple of differences: the file is looked for in all the directories listed in the @INC array; the code in the file will not be able to access lexical variables declared (with my) in the scope in which the do is executed. (for details, perldoc -f do).
-- dakkar - Mobilis in mobile
|
---|
In Section
Seekers of Perl Wisdom