L
Larry
I have just read up on sysread and I was struck by the following:
"*Attempts* to read LENGTH characters of data into variable SCALAR from
the specified FILEHANDLE, using the system call read(2)."
It made me wonder. What does that mean by "attemps" ?
I'm writing up a script to get binary data from <STDIN> (the script is
run on a normal web server and the data is sent to it by using http's
POST method)
I have a binary header on top of the raw data so here's what I'm doing:
# Get the header size: (4 bytes, int32)
sysread(\*STDIN, $buf, 4);
# Get the header:
sysread(\*STDIN, $header, unpack("N", $buf) );
# Get the raw data:
while( sysread(\*STDIN, $raw, 2048) )
{
...raw data...
}
close STDIN;
__END__;
Suppose sysread was to read a long header data like 65000 bytes, will
sysread actually be able to read all the data and store it on $header?
Do you think I should deal with that another way?
any help will be apreciated,
thanks
"*Attempts* to read LENGTH characters of data into variable SCALAR from
the specified FILEHANDLE, using the system call read(2)."
It made me wonder. What does that mean by "attemps" ?
I'm writing up a script to get binary data from <STDIN> (the script is
run on a normal web server and the data is sent to it by using http's
POST method)
I have a binary header on top of the raw data so here's what I'm doing:
# Get the header size: (4 bytes, int32)
sysread(\*STDIN, $buf, 4);
# Get the header:
sysread(\*STDIN, $header, unpack("N", $buf) );
# Get the raw data:
while( sysread(\*STDIN, $raw, 2048) )
{
...raw data...
}
close STDIN;
__END__;
Suppose sysread was to read a long header data like 65000 bytes, will
sysread actually be able to read all the data and store it on $header?
Do you think I should deal with that another way?
any help will be apreciated,
thanks