> -----Original Message-----
> From: Oliver Velten [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 23, 2001 9:32 AM
> To: '[EMAIL PROTECTED]'
> Subject: usage of require
> 
> 
> Hi,
> 
> I wrote a perl programm where i have a lot of strings defined 
> and a lot 
> of configuration data. To have a handy file where all 
> configuration is 
> stored and can be easily changed I want to use the require 
> function. So 
> I put after use CGI; a require config; I created a file called config 
> and put it to the same directory where the script resides. 
> The content 
> is like this:
> 
> @year = (2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011);
> etc.
> 
> But running the programm fails. What' wrong?

Fails in what way? Why make us guess?

Did you carefully read the documentation on require? I can
think of two reasons why it might be "failing":

   1. If config is a bareword, require will look for a file
      called config.pm, and it must exist in a location in
      @INC

   2. If the last expression in the file does not evaulate
      to true, the require will fail.

See:

   perldoc -f require
   perldoc -q require

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to