NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use
trunk.foswiki.org to view this page for some minimal testing.
Use
Item9693 for docu changes for 1.2 and 2.0.
This is a performance issue for a number of reasons, but most notably, as
CC has pointed out many times, because of the overhead of compilation.
There is an opportunity here to factor out common code in the same way thet
TWiki::Func does.
One of my favourite code fragments is :-
sub replaceVars {
my ($format, $data) = @_;
if (defined $data) {
if (defined $data->{wikiname}) {
$data->{username} = &TWiki::Func::wikiToUserName($data->{wikiname});
$data->{wikiusername} = &TWiki::Func::userToWikiName($data->{wikiname});
}
foreach my $key (keys %$data) {
$format =~ s/\$$key/$data->{$key}/g;
}
}
$format =~ s/\$n\b/\n/g;
$format =~ s/\$quot\b/\"/gos;
$format =~ s/\$percnt\b/\%/gos;
$format =~ s/\$dollar\b/\$/gos;
return $format;
}
Is this better as a core module or a Contrib?