Beefy Boxes and Bandwidth Generously Provided by pair Networks httptech
Problems? Is your data what you think it is?
 
PerlMonks  

Re: How do I include a file?

by ariels (Curate)
on May 22, 2002 at 08:55 UTC ( [id://168416]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to How do I include a file?

Notes on 2 of the above answers:
  • A Perl programmer who doesn't want to create <samp>EXPORT</samp> lists will use the simpler form
    use Module ();

    Also, note the subtle differences between require "Name" and require Name...

  • There's a difference between use and require (on the one hand) and do (on the other).

    <samp>do</samp> essentially reads and evals the file; like any <samp>eval</samp>, it returns the value calculated. This value may be logically true, or it may not be; it doesn't matter.

    <samp>require</samp> (and therefore <samp>use</samp> too) attempts to ensure some semantics are loaded. This might fail! So a required (or used) module is required (sorry) to return logical true if successful, or logical false if not. Thus the need to end those files with "1;" (or any other truth!). It's not needed if just <samp>do</samp>ing something (e.g. if loading a configuration file (unsafely)).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://168416]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.