shanestyle has asked for the wisdom of the Perl Monks concerning the following question:
I am using PERL as CGI to suck content into a template. Simple enough. Some of the content that I need to grab is from other departments, meaning they want to slip their navigation into my template's navigation. The template is set up to use a left navigation, so their navigation would be insterted under the link used to get to their department.
I am pretty new to PERL. Is there a way to have a config file that is read everytime a link is clicked, and if the link includes a certain var, then the config file would know to also grab navigation as well as content. Or am I making this to complicated? My usual tool is PHP, so the transition is not too bad, but I am not sure how to accomplish this.
Thanks.
Re: Using a template
by gryphon (Abbot) on Mar 14, 2003 at 16:39 UTC
|
Greetings shanestyle,
Simple answer: You could require your settings file from your Perl CGI script. First, create a settings.pl file. Insert into that file whatever settings, subs, whatever that are shared by your various CGI scripts. Then require settings.pl; from each of your CGI scripts. require is not exactly the same as use, so read a bit in the docs about require for additional info.
Better answer: Take a look at HTML::Template. It sounds like your situation may be really helped by that. Without knowing more specifics about your situation, I can't answer more directly. However, I can tell you that after having adopted HTML::Template, I can't code any other way.
gryphon
code('Perl') || die;
| [reply] [d/l] [select] |
Re: Using a template
by perrin (Chancellor) on Mar 14, 2003 at 17:38 UTC
|
| [reply] |
|