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.