Roland: Zu grosse Textdatei?

Beitrag lesen

Hallo Roland,

Ich benutze ein Perl/Cgi-Skript welches den Inhalt einer
Textdatei ausliest und im Browser darstellt. Ist die Datei
aber grösser als ca. 11 MB wird nichts dargestellt und es
kommt auch keine Fehlermeldung.

Durch stumpfe Wiederholung des Problems wird die Beschreibung
nicht besser :) Was hast du bereits ausprobiert? Wie sieht
dein Quelltext aus? Welche Perl-Version benutzt du? Was sind
das fuer Daten? Usw., usw.

Gruesse,
 CK

Perl-Version ist die 5.6.1
Die Daten bestehen aus einem automatisch generierten Logfile

Auszug aus dem Quelltext:

open (LOGFILE, "<$logfilepath") || die ("Can't open logfile $logfilepath: $! \n");
while (<LOGFILE>) {
  @log = split(/#/, $_);
        print "<TR BGCOLOR=$colno>";
        print "<TD NOWRAP>  $i  </TD>";

foreach $c (@CLF_LogColumns) {
                if ($cols_to_show{$c} ne "false") {

$tmp_str = $sorted_lines[$i][1][$CLF_type{$c}];

if ($sorted_lines[$i][1][$CLF_type{'proto'}] == 6) {
                                $proto = "tcp";
                        } elsif ($sorted_lines[$i][1][$CLF_type{'proto'}] == 17) {
                                $proto = "udp";
                        } else {
                                $proto = "icmp";
                        };

#
                        # resolve port and protocol numbers
                        #
                        if (($resolve_port) && ($c =~ /src-port|dst-port|nat-sport|nat-dport/ )) {
                                if (defined $LogMgr_ServiceByProtoPort{$tmp_str}{$proto}) {
                                        $tmp_str = $LogMgr_ServiceByProtoPort{$tmp_str}{$proto};
                                } elsif (defined $LogMgr_ServiceByPort{$tmp_str}) {
                                        $tmp_str = $LogMgr_ServiceByPort{$tmp_str};
                                };
                        };
                        if (($resolve_port) && ($c =~ /proto/ )) {
                                if (defined $LogMgr_ProtocolByNumber{$tmp_str}) {
                                        $tmp_str = $LogMgr_ProtocolByNumber{$tmp_str};
                                };
                        };

#
                        # resolve ip address
                        #
                        if ($c =~ /origin|src-ip|dst-ip|nat-src|nat-dst/) {
                                $src = $tmp_str;
                                if (($resolve_ip) && (defined $LogMgr_HostByAddress{$src})) {
                                        $tmp_str = $LogMgr_HostByAddress{$src};
                                } elsif ($resolve_dns) {
                                        $tmp_str = gethostbyaddr(inet_aton($src), AF_INET);
                                        $tmp_str = $src if (!defined $tmp_str);
                                };
                        };
                        print "<TD NOWRAP> $tmp_str </TD>";
                };
        };
        print "</TR>\n";
        NEXT_OUTPUT:
        $i++;
        last if $i >= $showlines;
};
print "</TABLE>\n\n";