powerhouse has asked for the wisdom of the Perl Monks concerning the following question:
I have a file that I use as a configuration file...
It looks similar to this:
My question is this.
I created a MySQL database, with this format:
id = autoincrement...
name = VARCHAR(100) ex: default_font_size
valu = VARCHAR(255) ex: 2
t = TIMESTAMP for last updated time.
Is there a way I can put the name as a variable that can be used in every page, since it's called in a "required" file, Not in the main script?
Would something like this work...
use CONSTANT $row->{name} => $row->{valu};
Or is there another way to do it, where Perl will use it through out the whole 'site'?
thx,
Richard
It looks similar to this:
Of course that is just an example.$default_font_family = qq~Arial~; $default_font_color = qq~#000000~; $standout_text_color = qq~navy~; $default_font_size = 2;
My question is this.
I created a MySQL database, with this format:
id = autoincrement...
name = VARCHAR(100) ex: default_font_size
valu = VARCHAR(255) ex: 2
t = TIMESTAMP for last updated time.
Is there a way I can put the name as a variable that can be used in every page, since it's called in a "required" file, Not in the main script?
Would something like this work...
use CONSTANT $row->{name} => $row->{valu};
Or is there another way to do it, where Perl will use it through out the whole 'site'?
thx,
Richard
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Constant Variables
by dragonchild (Archbishop) on Mar 27, 2003 at 23:31 UTC | |
by powerhouse (Friar) on Mar 28, 2003 at 00:07 UTC | |
by The Mad Hatter (Priest) on Mar 28, 2003 at 00:32 UTC | |
by powerhouse (Friar) on Mar 28, 2003 at 05:25 UTC | |
by The Mad Hatter (Priest) on Mar 28, 2003 at 16:23 UTC | |
by powerhouse (Friar) on Mar 28, 2003 at 05:45 UTC | |
by The Mad Hatter (Priest) on Mar 28, 2003 at 13:17 UTC | |
by zakb (Pilgrim) on Mar 28, 2003 at 11:17 UTC | |
by dragonchild (Archbishop) on Mar 28, 2003 at 14:43 UTC | |
Re: Constant Variables
by dga (Hermit) on Mar 28, 2003 at 16:44 UTC |
Back to
Seekers of Perl Wisdom