<html>
<br>
Ok, here goes with the background info before I get to the
questions:<br><br>
Whoever wrote this app wrote each CGI script as if it were the only one
in the whole thing.&nbsp; Code is duplicated all over the place,
particularly database connection stuff.&nbsp; I need to consolidate all
the database code into a package because the connection info
varies.&nbsp; <br><br>
The CGI scripts are called in the middle of html pages.&nbsp; All they do
(at least, the ones I'm dealing with just now) is pull a list of names
from the database and format them for the html.&nbsp; I've got the pages
using an included config file to decide what code to use to run the cgi
scripts, depending on physical location.&nbsp; That gruesome hack I
referred to comes into play here.&nbsp; PHP uses a regex on the working
directory to figure out whether it's on the development box (Win2k, how's
that for ugly... making these things work cross-platform sure is teaching
me a lot, though), in the test directory on the live server, or in the
live directory, and writes a string to whereami.txt indicating where it
is.&nbsp; <br><br>
When a CGI script is called, it reads from whereami.txt and sets the
database connection info accordingly.&nbsp; That's what I need to put
into a package.&nbsp; As a quick fix to get the feature I'm adding right
now working, I could rewrite those couple of scripts in PHP, but before
long I'll need that package anyway to make the rest of the site portable
between test and live versions.<br><br>
... I hope that made sense.&nbsp; :o)<br><br>
Questions concerning Exporter:<br><br>
1)&nbsp; Is using Exporter necessary/the best way to include a seperate
package file?<br><br>
2)&nbsp; The PHP include() reads the file into the current one as if the
code were written in the current file.&nbsp; I haven't come across
anything that I can recall in PHP regarding namespaces, but I have an ok
grasp of the concept.&nbsp; I think.&nbsp; The Exporter doc says
&quot;<font face="Courier New, Courier">use ModuleName; </font>This
imports all the symbols from ModuleName's @EXPORT into the namespace of
the <font face="Courier New, Courier">use statement.&quot; </font>Does
that essentially mean the same thing?<br><br>
3)&nbsp; I read that exporting method names isn't good.&nbsp; Is that why
you would use Modulename();, importing no symbols?<br><br>
4)&nbsp; It seems that 'symbols' refers to references to variable names
or to sub names.&nbsp; Is that right?<br><br>
Thanks in advance...<br>
<x-sigsep><p></x-sigsep>
Rebekah </html>