I certainly would love any feedback, negative or positive.

That sub's not very readable. Perhaps:

sub Get_Page_Vars { my ($temp_vars,$type) = @_; my $sth = $dbh->prepare (qq{ SELECT `name`,`value`,`add_name` FROM + `page_vars` WHERE `type` = ? OR `type2` = ? ORDER BY add_name,id,d}) +; $sth->execute($type, $type); while( my ($db_name,$content,$_add_name) = $sth->fetchrow_array()) + { { local $_ = $content; my $ident_key = qr/[\w{}']+/; my $phash_pat = qr/[$]$ident_key/; if (/$phash_pat/) { s/($phash_pat)/ eval($temp_vars{$1}) /ge; s/($phash_pat)/ $temp_vars{eval($1)} /ge; s/($phash_pat)/ eval($vars{$1}) /ge; s/($phash_pat)/ $vars{eval($1)} /ge; s/($phash_pat)/ eval($1) /ge; } if (/\<templ_var ($ident_key)\>/) { s/\<templ_var ($ident_key)\>/ eval($vars{$1}) /g +e; s/\<templ_var ($ident_key)\>/ $vars{eval($1)} /g +e; s/\<templ_var ($ident_key)\>/ eval($temp_vars{$1}) /g +e; s/\<templ_var ($ident_key)\>/ $temp_vars{eval($1)} /g +e; s/\<templ_var ($ident_key)\>/ eval($1) /g +e; } if (/{{$ident_key}}/) { s/{{($ident_key)}}/ eval($vars{$1}) /ge; s/{{($ident_key)}}/ $vars{eval($1)} /ge; } s|<br>|<br />|gi; $content = $_; } if ($content && ($content =~ /<code>/i && $content =~ /<\/code +>/i)) { while($content =~ /<code>/i && $content =~ /<\/code>/i) { my ($code1,$code2,$_do_code); ($content,$code1) = split /<code>/, $content, 2; ($code2,$ocontent) = split /<\/code>/, $code1, 2; $_do_code = eval($code2); $content = $content . $_do_code . $ocontent; } } if ($content && ($content =~ /<syscode>/i && $content =~ /<\/s +yscode>/i)) { while($content =~ /<syscode>/i && $content =~ /<\/syscode> +/i) { my ($syscode1,$syscode2); ($content,$syscode1) = split /<syscode>/i, $content, 2 +; ($syscode2,$ocontent) = split /<\/syscode>/i, $syscode +1, 2; eval{$syscode2}; $content = $content . $ocontent; } } if ($_add_name) { $content = qq~<!--Start $db_name-->$content<!--End $db_nam +e-->~; } $temp_vars{$db_name} = $content; } $sth->finish(); return(%temp_vars); }

Less visual noise.


Life is denied by lack of attention,
whether it be to cleaning windows
or trying to write a masterpiece...
-- Nadia Boulanger

In reply to Re^2: use of useless void in context by missingthepoint
in thread use of useless void in context by Anonymous Monk

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.