+ $template =~ s/$extract/$replacement/g; # Block durch neue Daten ersetzen
+ }
+ $self->set_template($template);
+}
+
+# parse_includes()
+#
+# {INCLUDE}-Anweisungen verarbeiten
+#
+# Parameter: -nichts-
+#
+# Rueckgabe: -nichts- (Template-Objekt wird modifiziert)
+
+sub parse_includes
+{
+ my $self = shift;
+ my $template = $self->get_template;
+
+ while($template =~ /(\{INCLUDE (\S+?)\})/)
+ {
+ my ($directive,$file) = ($1,$2);
+ my $qm_directive = quotemeta($directive);
+ my $replacement = '';
+
+ if(-f $file)
+ {
+ local *FILE;
+
+ open(FILE,'<'.$file) or croak "Open $file: $!";
+ read(FILE, $replacement, -s $file);
+ close(FILE) or croak "Closing $file: $!";
+ }
+
+ $template =~ s/$qm_directive/$replacement/g;