Ah, if it's homework, you should have told us that, and the parameters of that homework.
Here is a hint for you: When you look at the communication
with your webserver, you will first see the echo of your request (maybe that only happens with telnet, you need to check), terminated by a blank line.
After that you see the headers sent by the server, terminated by a blank line.
You do not need to know how the wanted content starts. All you need to know is how the unwanted content ends.
There, that should be enough of a hint :-) | [reply] |
hmm, I see. Well the unwanted part ends like this:
Accept-Ranges: bytes
Content-Length: 21696
Connection: close
Content-Type: image/gif
\n
the problem is that, on certain days the file is a different format (gif), and well I know how to tell perl how to match for the end, I am not sure how to tell it to start recording AFTER it reaches that point.
| [reply] |
Quit thinking about what the unwanted content looks like.
Concentrate on the empty lin that separates it from the wanted content. And regardless of what the wanted format is, the empty line is always there. So you need to remove everything up to and including the empty line. This is your homework now: figure out how to skip everything up to and including the blank line.
| [reply] |