<!-- #INCLUDE FILE = "pcConstants.asp" -->
<!-- #INCLUDE FILE = "pcFunctions.asp" -->
<!-- #INCLUDE FILE = "pcErrors.asp" -->
<!-- #INCLUDE FILE = "pcXML.asp" -->
<!-- #INCLUDE FILE = "Merchant.asp" -->
<!-- #INCLUDE FILE = "Kiosk.asp" -->
I discovered that doing a similar thing in Perl, with 'use', does not work. If I 'use' the function files in a global file, like 'pcGlobal.pm', then 'use pcGlobal' in other files, the namespace isn't inherited, so I can't just call functions from the function files in the current file without explicitly specifying the package name - which makes the include file pointless. Right now I'm just doing a 'use' on each function file every place it is needed instead. But, for purposes of keeping each implementation as much like the others as possible, if I can find the magic to make the include file work, I'll take it.
The other problem I have is that neither ASP nor CF seem to have a problem with recursion. Say a routine in pcFunctions is used in Merchant, and a routine in Merchant is used in pcFunctions. In ASP and CF, both of these files are included in pcInclude, and both of them them include pcInclude. So no problem, the functions are all in a flat namespace and the calls work just dandy.
Perl got REALLY unhappy when I tried to do 'use Merchant' in pcFunctions, and 'use pcFunctions' in Merchant - it recurses. The work around for now is doing 'use pcFunctions' in Merchant, and then using the explicit package name on the calls in pcFunctions (Merchant::*) instead of doing the include. Is this the best way to handle it?