Hallo!
Ich erhalte bei einem Programmaufruf immer die Fehlermeldung
QuoteUncaught exception from user code:
[Thu Jun 10 16:19:58 2004] cms.cgi: Error executing run mode 'index': HTML::Template->new() : fatal error occured during filter call: Can't use an undefined value as an ARRAY reference at C:/Perl/site/lib/HTML/Template/Extension/HEAD_BODY.pm line 85.
[Thu Jun 10 16:19:58 2004] cms.cgi: at C:/Perl/site/lib/CMS.pm line 200
CGI::Carp::realdie('[Thu Jun 10 16:19:58 2004] cms.cgi: Error executing run mode ...') called at C:/Perl/lib/CGI/Carp.pm line 403
CGI::Carp::die('Error executing run mode \'index\': HTML::Template->new() : f...') called at C:/Perl/site/lib/CGI/Application.pm line 143
CGI::Application::run('CMS=HASH(0x1cdd134)') called at cms.cgi line 15
Soweit ich das jetzt verstanden habe bedeutet das, dass ich angeblich eine leere Scalarreferenz übergebe.
Die ist aber voll!
print STDOUT Data::Dumper::Dumper(\$filecc2);
# => $VAR1 = \'<?xml versio...ml>';
Der Fehler resultiert aus folgender Zeile:
my $last_idx = scalar @{$self->{tokens}->{$tag}}-1;
aus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
sub tokenizer_header {
# prende l'header contenuto in $self->{header} e ne estrae i
# token fondamentali inserendoli in $self->{tokens}
my $self = shift;
my $header = $self->{header};
$header =~m|<head>(.*?)</head>|smi;
$header = $1;
my $p = HTML::TokeParser->new(\$header);
$self->{tokens} = {};
while (my $token = $p->get_tag()) {
my $tag = $token->[0];
my $type = substr($tag,0,1) eq '/' ? 'E' : 'S';
my $tag_text;
if ($type eq 'S') {
$tag_text = $token->[3];
my $text = $p->get_text();
my $struct = [$tag_text,$text,undef];
push @{$self->{tokens}->{$tag}},$struct;
} elsif ($type eq 'E') {
$tag = substr($tag,1,length($tag)-1);
$tag_text = $token->[1];
my $last_idx = scalar @{$self->{tokens}->{$tag}}-1;
$self->{tokens}->{$tag}->[$last_idx]->[2] = $tag_text;
}
}
}
Das ist das Modul HTML::Template::Extension::HEAD_BODY
Kann mir da wer weiter helfen?
mfg pktm