in reply to Parsing Templates
If your variables aren't declared, you could copy them to an hashref and pass this hashref to your template parser.s/%tag%/$value/g if defined $value;
$hash = {key1 => 'value', key2 => 'value'}; ... foreach my $key (keys %$hash) { s/%$key%/$hash->{$key}/eg; }
|
|---|