?
Solved

exporting vars from nested "do file;"

Posted on 2002-05-26
6
Medium Priority
?
160 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 84

Accepted Solution

by:
ozo earned 600 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

741 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