gonokokkus: Perl CGI HTML Ausgabe während das Script läuft

Hallo,

meine Frage dreht sich um das Thema Perl und Apache. Wie kann ich es bewerkstelligen, dass der HTML Output meines Perl CGi Script nicht erst am Ende des Scripts auf einmal ausgegeben wird, sondern noch während das Script läuft.

Also wenn ich Statusmeldungen ausgeben möchte z.B. bei einem Upload. Sowas wie

  • Der Dateiname wird extrahiert
    ...Erfolgreich
  • Die Datei wird auf Viren überprüft
    ...Erfolgreich
  • Upload der Datei
    ...Erfolgreich
  • Upload
    ...erfolgreich!

Bis jetzt würde Perl den Output am Ende - alles auf einmal - ausgeben.
Aber mir wäre eine Ausgabe wärend des Script lieber.

Ich hoffe ihr habt mich verstanden...da ich nicht weiß, wie die Option heißt und es so gut wie möglich versuche zu erklären.

Danke für eure Hilfe

Gruß, gon

  1. Ich hoffe ihr habt mich verstanden...da ich nicht weiß, wie die Option heißt und es so gut wie möglich versuche zu erklären.

    Vielleicht willst du den Buffer leeren:

    Aus der Perl Doku:

    HANDLE->autoflush(EXPR)
    $OUTPUT_AUTOFLUSH
    $|
        If set to nonzero, forces a flush right away and after every write or print on the currently selected output channel. Default is 0 (regardless of whether the channel is really buffered by the system or not; $| tells you only whether you've asked Perl explicitly to flush after each write). STDOUT will typically be line buffered if output is to the terminal and block buffered otherwise. Setting this variable is useful primarily when you are outputting to a pipe or socket, such as when you are running a Perl program under rsh and want to see the output as it's happening. This has no effect on input buffering. See getc in the perlfunc manpage for that. (Mnemonic: when you want your pipes to be piping hot.)

    Allerdings:
    Wenn du das in einem CGI Kontext brauchst, könnte das ein Hinweis sein, das dein Script irgendwo unnötig langsam ist.

    Der Output erfolgt normalerweise sofort ab dem ersten Print Befehl, und wird dann freigegeben, wenn der Block voll ist.

    mfg Beat

    --
    Woran ich arbeite:
    X-Torah
    ><o(((°>        ><o(((°>
       <°)))o><                      ><o(((°>o