Dave, I appreciate your concern on the code quality. Perhaps, I haven't made it clear that the code was a skeletal program, in other words a quick "look and see" about the variables that I need to work with. The program was quickly written up so I don't need to keep explaining what I wanted to do and is in no form part of the "real" program

Another point I'd like to make is that the file containing sqls could easily be just a lot of text of some kind where you have to have some variables placed. So in light of the question posted, along with the sample code, there is no unsanitized sqls passed to the dabase for execution. There is not even a single database connecion in the sample code, in fact DBI is not even called here.

So if I can paraphrase the original question: I read in a file that contains text and some perl variables. The text is split into records into a hash. How can display the hash values so they interpolate the variables into the text?


In reply to Re^2: Variable interpolation in a file to be read in by tapolyaip
in thread Variable interpolation in a file to be read in by tapolyaip

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.