been away for a while and am a bit rusty. I would appreciate a nudge with this issue, please.
I have a main script, which establishes a $db_connect and a $session.
It passes this to a doctype_and_header.pl - for outputting the, erm, doctype and the rest of the head section of the html output.
Doctype_and_head.pl works out the $css values from a db_connection and uses them in the following line:
Now, here's the problem...
<link rel="stylesheet" href="/cgi-bin/stylesheets.pl/$css1$css2$css3" type='text/css' media='screen' />
stylesheets.pl will load the existing $session using:
But, how do I pass the $db_connect handle?
my $session = load CGI::Session($cgi) or die CGI::Session->errstr;
I imagine it's not secure to store the $db_connect in the $session, even if possible. I have tried but i get an overload warning.
And I wonder if establishing a connect specificallty for this script, is placing undue/unnecessary demands on the server.
So, should I make a connection for stylesheet.pl and terminate it at the end of this script (as soon as it is finished its db job), or, is it possible to pass the existing $db_connect from doctype_and_head.pl using the html line above (or some other way)?
Maybe there is a completely different way to output the css whilst keeping it as an external resource?