Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Using a template

by gryphon (Abbot)
on Mar 14, 2003 at 16:39 UTC ( #243111=note: print w/replies, xml ) Need Help??


in reply to Using a template

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;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://243111]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2020-11-30 05:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?