Gossamer Forum
Home : Products : DBMan : Customization :

Splitting Html.pl in to two?

Quote Reply
Splitting Html.pl in to two?
I have to use DBMan to manage multiple small databases .. I am using mod html long /short.

My question is .. Can I Use certain sub routines from html.pl putting them in a separate file e.g. 'routines.pl'? I want to put those subroutines there which are constant for every database and those which need frequent changes will remain in html.pl as per their individual database.

okay I extracted the constant sub routines from html.pl and put them in a separate file and then added the following line in default.cfg

require $db_script_path .
require $db_script_path . "/routines.pl"; ### ADDITION ###

Put the routines.pl in same directory with html.pl and chmod it 0666.

but it didn't work. please help me what I need to do additionally?

My question simply can be considered as I want to split html.pl in two files both containing different routines and should work with main script?

Is it possible or I am a dreamer?



Quote Reply
Re: [zeshan] Splitting Html.pl in to two? In reply to
Are you using the user friendly short/long mod for DBMan?

That is setup with instructions to place the page top and bottoms within a separate file. You can also move other subs into a separate file.

Rather than putting your require $db_script_path . "/routines.pl"; ### ADDITION ###

in your .cfg file .. add it to your html.pl files.

require $db_script_path . "/routines.pl";

before the section:

## Record Layout ##

Unoffical DBMan FAQ

Quote Reply
Re: [LoisC] Splitting Html.pl in to two? In reply to
Thanks Lois for your help.

It worked BUT I had to add a back require in my new routines.pl file for original html.pl too:

require $db_script_path . "/html.pl";

So the problem still stands there, for each database I have to have a separate routines.pl because it will be requiring its particular html.pl

any ideas?
Quote Reply
Re: [zeshan] Splitting Html.pl in to two? In reply to
Check out these threads and see if you can find a solution for your application.

Without more specific information it's hard to know exactly what you are trying to pull from what file :)

Multiple .pl files for different views

one html.pl for multiple db configs

Hope these will help.

Unoffical DBMan FAQ