read(STDIN, $url, $ENV{"CONTENT_LENGTH"}, 6);
^
|
Diese 6 heißt doch: Lies ab dem 6. Byte, oder?
Mmh, den read-befehl habe ich so noch nie benutzt, aber die Perl-Hilfe dazu sagt folgendes:
---snip---
dralli@hiltrud:~ > perldoc -f read
=item read FILEHANDLE,SCALAR,LENGTH,OFFSET
=item read FILEHANDLE,SCALAR,LENGTH
Attempts to read LENGTH bytes of data into variable SCALAR from the
specified FILEHANDLE. Returns the number of bytes actually read,
C<0> at end of file, or undef if there was an error. SCALAR will be grown
or shrunk to the length actually read. An OFFSET may be specified to
place the read data at some other place than the beginning of the
string. This call is actually implemented in terms of stdio's fread(3)
call. To get a true read(2) system call, see C<sysread()>.
---snap---
Was ich so verstehe: die eingelesenen Daten werden ab dem Offset in die Variable geschrieben. Wenn also $url z.B. den Wert "Thunfischpizza" hat und du mit dem Befehl
read(STDIN, $url, $ENV{"CONTENT_LENGTH"}, 6);
deinen Link einliest, steht danach in $url
Thunfilink=/cgi-bin/anderes_script.cgi?zeige=nur_neue_texte
Falls $url leer ist, stehen halt vor dem "link=..." noch ein paar Null-Bytes.
Kann mich aber auch irren, hab ich noch nicht ausprobiert...
Gruß
Thorsten