On 04/22/2011 05:33 PM, sono...@fannullone.us wrote:
> I've been working with an older Perl shopping cart script and the placeholders it uses are only accessible on pages that are placed under the cgi-bin directory,

Is there documentation for this script on the WWW? If so, what is the URL? If not, please explain "placeholders" and how the script works.


I assume you have the source code for the script? If so, perhaps you can modify it to work with pages in places other than the cgi-bin directory?


> Let me rephrase my question. I want to show pricing and other dynamic information from my shopping cart on my static HTML pages throughout my site. I know I can do it with PHP, but being that the cart is written in Perl - and I really want to stick with Perl - I thought there might be a way to show this info from my store with some kind of a Perl templating system. > Being that the info is in a MySQL db, I don't need to access the cart, but I'd like to find a way to use Perl to insert this info on those pages.

I'd say use the best tool for the job, regardless of what language the shopping cart script is written in. That said, my brain scrambles when I try to use two similar languages at the same time (e.g. Perl and PHP). I do better using one language, and I prefer Perl.


If you know the schema for the shopping cart database, Perl can read the data via the DBI and DBD::mysql modules. Putting the data into static HTML pages depends upon your web server. I use Apache 2.2. Assuming an unpriviledged name-based virtual hosting account, I'd try an Apache rewrite rule in .htaccess that sends the request to a CGI script, that in turn reads the page, reads the data, feeds them through a template engine (say, HTML::Template), and sends the result.


I don't remember enough about Mason to suggest how to integrate Mason with your existing script and static pages. I'd ask the question on the mason-users mailing list:

    https://lists.sourceforge.net/lists/listinfo/mason-users


E-commerce is a known killer app. Perhaps you should migrate your site to an open-source e-commerce platform and configure/ brand it to meet your needs? For example, Interchange:

    http://www.icdevgroup.org/i/dev


HTH,

David

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to