One thing at a time all the time!

Welcome to Rocteur
Friday, April 26 2024 @ 06:08 PM CEST

How do I call a parameter file with variable declarations ?

Create your template file like this:

our $header = '...';
our $footer = '...';

In your script call the template file like this:

require "/path/template.file";
our $header;
our $footer;

print $header; # it should get the variable's value you defined in the template.file
print $footer; # the same

Also about perl's variable scope,please read this article:
http://perl.plover.com/FAQs/Namespaces.html.en
--
Jeff Pang

FAQ Manager » Perl » How do I call a parameter file with variable declarations ?