Usually, when I wrote SQL queries, they were pretty simple, very small scripts that would run for specific situations.
A long time ago, I tried to write a database application utilizing MySQL but that failed :( Mostly due my inability to configure MySQL at the time. I was eventually forced to use Access for that application.

I'm now trying again, this time with Perl. And I've got the MySQL server running quite nicely :)
The question I have at hand is what is the practice of seperating the MySQL statements from the Perl script itself. I remember, from an early SQL class that there is the practice of seperating such a program into three modules. DB Backend, UI Frontend, and... er... glue(?). Change the backend, and the frontend stays the same. And vice versa.

Searching around the web, I don't find very many examples of this practice, if any at all. Are there any examples showing the seperation between the three modules in a practical example

The book I have from the SQL class discusses it on an accademic level, which is rather useless. I understand where you draw the line. What I don't understand is the fine working details. For example. I have Table A. Do I create multiple functions to extract only the necessary information I want from Table A. Or is it easier to create one Universal function to pull the table rows, and use the, "glue," to extract the elements I want and take a performance hit?

Thanks for your patience.

Prove your knowledge @ HLPD


In reply to Mixing Mysql and Perl by SavannahLion

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.