Hi,
 the one way to use the config file is
        1. Don't use my to declare variables inside the config file.
        2. In the perl program just require the config file and the
variables and its values will be a available in the perl program.
        3. use "require <filename>;" statement to use the subroutines of
the file named <filename> in some other program.

Rgds,
vinai

-----Original Message-----
From: Brian Ling [mailto:brian.ling@;bbc.co.uk] 
Sent: Friday, November 01, 2002 3:11 PM
To: [EMAIL PROTECTED]
Subject: Reading config files


Hi All

I have a main Perl program that needs to read in a config file that just
sets some variable values, what is the best way to do this. The config
file can be in any format I want such as:

#!/usr/bin/perl
my $var = 3;                    
my $var1 = 4 ;
my $var2 = 234; etc 

So how could I run this from within my main program so that the var can
be used afterwards, or is there a better way of achieving the same
result.

On a side topic, how do multiple source code files work in Perl. How can
you do things such as include another file so that I can use it's
subroutines.

Any pointer would be welcome.

Thanks

Brian



BBCi at http://www.bbc.co.uk/

This e-mail (and any attachments) is confidential and may contain 
personal views which are not the views of the BBC unless specifically 
stated.
If you have received it in error, please delete it from your system, do 
not use, copy or disclose the information in any way nor act in 
reliance on it and notify the sender immediately. Please note that the 
BBC monitors e-mails sent or received. Further communication will 
signify your consent to this.


**************************Disclaimer************************************

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***************************************************************************

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

Reply via email to