Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: Re: Loading a function from another file dynamically?!

by dakkar (Hermit)
on Mar 23, 2003 at 19:26 UTC ( #245307=note: print w/replies, xml ) Need Help??


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
  • Comment on Re: Re: Re: Loading a function from another file dynamically?!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://245307]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2022-05-16 18:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (63 votes). Check out past polls.

    Notices?