Thank you so much!!!

Yeah, I saved it for ease, I guess I should have put the whole subroutine in there.

I'm saving it after the 2nd while statement, inside the first one(that gets stuff from the db) into a hash like this:$template{$dbname} = $_content;

I'm taking it out of the database, with $content. I'm putting it in the $_content from the while <> statement.

I got it to work like this:
The Whole Subroutine that is getting data from the database, settings and everything:
sub Get_Page_Vars { my ($temp_vars,$type) = @_; $sth = $dbh->prepare (qq{ SELECT `name`,`value`,`add_name` FROM `p +age_vars` WHERE (`type` OR `type2`) = ? }); $sth->execute($type); # I know I should have done this different : +o) while(my ($db_name,$content,$_add_name) = $sth->fetchrow_array()) +{ $content =~ s/\<templ_var ([a-zA-Z0-9\{\'\}_]+)\>/ eval ($vars +{$1}) /ge if $vars{$1}; $content =~ s/{{([a-zA-Z0-9\{\'\}_]+)}}/ eval ($vars{$1}) /ge +if $vars{$1}; if ($_add_name) { $content = qq~<!--Start $db_name-->$content<!--End $db_nam +e-->~; } $temp_vars{$db_name} = $content; } $sth->finish(); return(%temp_vars); }


I don't know why I did not think of the things you suggested, I thought about doing it, but could not call to mind how to try it. Thank you for your advice, tips and comments. I really appreciate it!

thx,
Richard

In reply to Re: <FILE> Questions by powerhouse
in thread <FILE> Questions by powerhouse

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.