![]() |
|
Perl: the Markov chain saw | |
PerlMonks |
Passing variables to scripts rans through 'do'by c (Hermit) |
on Dec 02, 2001 at 19:28 UTC ( #128985=perlquestion: print w/replies, xml ) | Need Help?? |
c has asked for the wisdom of the Perl Monks concerning the following question:
i am working on dynamically building a .conf file by using
"include" like statements within a script. i read over this
which pointed me towards reading this and got me off on the
right foot. however, some of the scripts ran through 'do'
need to be able to pull variable values from the original
script. an example will hopefully clarify:
genconf.pl
###
genheader
the genconf.pl file executes and runs the three external scripts. each of the external scripts just prints out a line of text. however, as you can see in genheader, a portion of the text requires some sort of knowledge about a variable set within the main script. the only way i figured i could get around this is to try something like: genconf.pl
###
genheader
but i dont believe that i am really understanding require because the magic just isnt happening with this code either. i think using the require or even a 'use' statement for a future module possibility(?) may be the way i want to go, however, i am not certain what i am missing in my required file to make it work. could someone enlighten me? humbly -c
Back to
Seekers of Perl Wisdom
|
|