Actually, HTML::Template loads the html off the file system. You do something like:
my $t = HTML::Template->new(filename => $file);
And pass any dynamic elements in.

We have an inhouse module called SQL::Serialized which is basically an autoload method that takes the method name, attaches .sql to the file and tries to load the query out of a file with that name.

We have been toying with releasing it vs rewriting it to use Inline (Inline::SQL). Then, we could also do something like Inline::HTML::Template.

This probably sounds goofy, but there is one situation in which SQL::Serialized is a massive bitch: utility scrips; the support files (.sql's) either have to be in a hardcoded location or the current directory.

My idea was to take advantage of using __DATA__ blocks for storing queries so that we don't have to deal with sql files for that. Inline has support for this sort of thing.

But, as it stands, currently, queries look like this

my $dbh = DBI->connect; my $sql = SQL::Serialized->new(directory => './sql'); my $sth = $dbh->prepare_cached($sql->big_query); $sth->execute(@place_held);
My views come from the fact that if you change database, you are going to have to change your SQL anyway. Although, one person I know says that if you write all your sql against dbase or some silly, lowest common denominator, databse that isn't the case.

In reply to Re: Re: Re: Rebuttle to chromatics by DrZaius
in thread Rebuttle to chromatics by princepawn

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.