sub convert { my $text_ref = shift; $$text_ref =~ s/\[\%=(.*?)\%\]//g; $$text_ref =~ s/\[\%\/(.*?)\%\]/<\/TMPL_$1>/g; $$text_ref =~ s/\[\%(.*?)\%\]//g; }