This reads every $string in the text file, and replaces it with the perl value of $string since it normally would not, because of it being in a text file and not read as a string by Perl.open(FILE, "/home/user/template/$filename.txt"); while (<FILE>) { s/(\$[a-zA-Z0-9\{\'\}_]+)/ eval ($1) /ge; $template{'content'} .= $_; } close(FILE);
while(my ($db_name,$content,$_add_name) = $sth->fetchrow_array()) { s/\<templ_var ([a-zA-Z0-9\{\'\}_]+)\>/ eval ($1) /ge; s/{{([a-zA-Z0-9\{\'\}_]+)}}/ eval ($1) /ge; $_content = $_; if ($_add_name) { $_content = qq~<!--Start $db_name-->$_content<!--End $db_name- +->~; } $temp_vars{$db_name} = $_content; }
In reply to <FILE> Questions by powerhouse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |