sub Get_Page_Vars { my ($temp_vars,$type) = @_; $sth = $dbh->prepare (qq{ SELECT `name`,`value`,`add_name` FROM `page_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/\/ 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~$content~; } $temp_vars{$db_name} = $content; } $sth->finish(); return(%temp_vars); }