Solved

exporting vars from nested "do file;"

Posted on 2002-05-26
6
149 Views
Last Modified: 2013-11-18
I have a configuration file I read using
  do "config.rc";
Usually it just contains some assignments. But now I need to read another file from this one. When I put inside config.rc the statement
  do $nested_config_file;
then the variables assigned inside the nested config file are not defined in the main program.

How can I make the variables defined in the nested config file available to the main program, without changing the main program code?
0
Comment
Question by:yonat
  • 3
  • 2
6 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 7036457
How are the variables assigned inside the nested config file?
How are you setting $nested_config_file ?
0
 
LVL 5

Author Comment

by:yonat
ID: 7036487
The nested config file is just a series of
    $some_var = 'some_value';
assignments.

$nested_config_file is based on some CGI parameter, and I checked and made sure that it does indeed hold the right path, so I know this is not the problem.
0
 
LVL 5

Author Comment

by:yonat
ID: 7036494
Just to make sure: by Perl's definition, are the variables SUPPOSED to be available to the main program? I mean, should I just look for some little error somewhere, or do I need write some explicit code to export them?
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 84

Accepted Solution

by:
ozo earned 150 total points
ID: 7036627
The variables should be available to the main program.
Can you post some sample code that does not do what you expect?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7036817
if say CGI, is your perl program run by a webserver?
WHen will the nested rc file be generated?
0
 
LVL 5

Author Comment

by:yonat
ID: 7037596
Thanks for your help guys. After understanding that this is not a Perl problem, I found out that I did not set the permissions for the nested config file correctly. Now everything works!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
wordpress limitations 4 124
jQuery Date picker not working 16 188
cookies analysis tools 2 100
Problem to page 4 93
Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
The viewer will learn how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question