Posted by alexjaquet on 04/25/06 19:25
thanks Justin for responding
-What is the context of this?
I want to open an html file, parse it and replace all
$LABEL{'label_name'} variables by the key values pairs who are placed
in an config config file I do this to *delete php code* in html page
(MVC2)
for example to store in an hash table the keys values I do :
sub loadLanguage {
$lang = $query->param("lang");
$lang = uc ($lang);
open (FILE, "<$dirLang/$lang.conf") or die "cannot open file
$dirLang/$lang.conf";
while (<FILE>) {
(local our $label, local our $value) = split(/=/);
$SERVER{$label} = $value;
}
close (FILE);
}
[Back to original message]
|