[ic] perl in interchange.cfg or catalog.cfg?

Dan B db@cyclonehq.dnsalias.net
Fri, 04 May 2001 09:53:31 -0700


At 09:38 AM 5/4/2001 -0700, you wrote:
>At 11:28 AM 05/04/2001 -0400, you wrote:
>>Is there an easy way to embed perl in the interchange.cfg or catalog.cfg
>>files similar to <perl> sections in httpd.conf (apache/mod_perl)? I am
>>trying to link my interchange configuration with my mysql database. I
>>found a way but it involved making changes to Vend/Config.pm. I am using
>>4.7.1.
>>
>>Bill Carr
>>Worldwide Impact
>>bill@worldwideimpact.com
>>413.253.6700
>
>Hmmm...take a look at the docs on User defined tags, and also the 
>Globalsub directive for interchange.cfg (Config docs).
>
>You've lost me (and no doubt others) with 'link my interchange 
>configuration with my mysql database' - Interchange supports mySQL for 
>databases via the Perl DBI - did you read the docs for 'Interchange Database'?

I think what Bill is trying to do sounds interesting, e.g.:
(psuedocode)
Catalog.cfg:
[perl]
         if (date() == Tuesday){
                 query_msyql("SELECT catalog_cfg FROM catalogs_config_files 
WHERE use_date="tuesday");
         }
         return results;
[/perl]

Which would allow you to use a given set of configuration depending on 
arbitrary perl code (such as database contents via the day of the week).

There's probably a way to do this already, but I don't know it.

Dan Browning, Cyclone Computer Systems, danb@cyclonecomputers.com