At 11:00 PM 5/10/01 -0500, you wrote:
>Can anyone point me to some simple resources on
>understanding/implementing state machines in Perl/SQL?
>
>I'm working on an ecommerce site and getting sick of all the standard
>kludgy redundant code for maintaining state, session ID's etc.  I keep
>hearing that there are these things called "state machines" which will
>auto-magically track all these variables.
>
>I need a fairly elementary primer with LOTS of examples.
>

A 'state machine', in th CS sense, may not be what you need, depending on
what it is your actually trying to do. But then, I'm no expert in that sense.

However, another path I would recommend looking into, if you are not locked
into some other server, is using a database and the mod_perl Perl API for
the Apache web server. This allows you to write handlers for pretty much
any and every stage of a request/childs life cycle, storing any data or
state you need either in global variables (managed _very_ carefully) within
code, or in temporary and/or permanent tables with a database.

This may be more work than reasonable if you have a lot of code to port
(partic. if it's not in standard Perl and/or CGI), but would allow you to
design your system to completely meet your needs, with complete control
over what 'state' you choose to maintain, and how long. Check out "Writing
Apache Modules with Perl and C" from O'Reily and it's website
http://www.modperl.com/, for more information. The top webpage contains
links to Apache, mod_perl and other's sites that also contain relevant info
to look into this possibility further.

Sean P. Quinlan
mailto:[EMAIL PROTECTED]
508-533-0582

Reply via email to