Hi nochmal,
Schön langsam fängt der oben genannte Fehler mich an, etwas zu ärgern. Das Script funktioniert zwar wunderbar, aber ich habe im errorlog immer diese Meldung stehen. Ich schätze ich konnte den Fehler auf folgenden Code eingrenzen :
opendir(DIR,'messages') or die "Cant open postings : $! \nPlease send a mail to $mailadmin to report this error\n";
while (defined($_ = readdir(DIR))) {
if ($_ =~ /^\d+?.cgi$/) {
my $headdata = '';
open(FILE,"messages/$_") or die "Cant open $_ : $! \nPlease send a mail to $mailadmin to report this error\n";
for (my $i = 0; $i <= 5; $i++) { #die ersten 5 Zeilen einlesen
my $line = <FILE>;
$headdata .= $line;
}
close FILE;
my $unixzeit = $1 if $headdata =~ /<unixzeit>(\d+?)</unixzeit>/;
my $thema = $1 if $headdata =~ /<topictitle>(.+?)</topictitle>/;
my $firstmessby = $1 if $headdata =~ /<firstmessby>(.+?)</firstmessby>/;
my $lastmessby = $1 if $headdata =~ /<lastmessby>(.+?)</lastmessby>/;
my $lastdate = $1 if $headdata =~ /<lastdate>(.+?)</lastdate>/;
print "<tr><td class="topiclinks"><a href="$baseurl?action=showreplies&posting=$_">$thema</a></td><td class="topic"> $firstmessby </td><td class="topic"> 1 </td><td class="topic"> 2 </td><td class="topic"><span class="replyname">$lastmessby</span><br> $lastdate </td></tr>\n";
}
}
closedir DIR;
Der Fehler muss irgendwie nach my $line = <FILE> auftreten.
Ich hatte vorher das "close FILE" nach der print Anweisung stehen, wobei ich die Meldung : Use of uninitialized value in concatenation (.) or string at c:\apache\forumneu\index.cgi line 152, <FILE> line 6.
bekam. Womit hängt das zusammen?, und vielleicht hilft es, wenn ich sage, dass die Meldung gleich 14 Mal hintereinander im Errorlog steht (Es werden 7 Files eingelesen).
Wo ist der Fehler ?
$xNeTworKx.