in reply to Re: need a regular exdpression in perl
in thread need a regular exdpression in perl
Slightly off-topic, but when writing such a templating engine, I prefer to deal with missing replacement values by leaving the template parameters as-is (that is, replacing the template parameter by itself instead of a (missing) value):
$string =~ s|(\@begin.*?\@end) |shift @replace // 'Missing parameter for ' . $1 |sexg;
I find this helps me debug the template better, as I easily see which template expression failed. This still does not help me see why a value was missing, but at least I know where the value was missing.
|
|---|