#include for Perl?

Keary Suska hierophant at pcisys.net
Tue Oct 15 01:01:05 CDT 2002


on 10/14/02 11:02 PM, jtevans at kilnar.com purportedly said:

> I'm writing a set of Perl scripts that share a common set of
> configuration variables. When one variable changes, I would like to change
> one file and have all scripts recognize the change. Somethign akin to what
> "#include" does for C.
> 
> use "./config.inc";
> # Also tried eval and require.

This is an easy thing to do, and the require should work best in most
circumstances. What seems to be wrong? The require'd file must return a true
value, and if you "use strict" you you will need to declare the vars as
global using our() (5.6+) or use vars, and require it in the global scope
for good measure.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"




More information about the Pikes-peak-pm mailing list