I believe the practice of this forum is not to encourage excessive spoon feeding, instead, to give you pointers for you to explore on your own, to give you an opportunity to learn.
The HEAD HTTP method is frequently used instead of GET to get the headers without downloading the message body. That seems to fit what you want. But you can use GET if you like.
Look at this for example:
http://search.cpan.org/~gaas/libwww-...808/lib/LWP.pm
I think it should be enough to get you going about the HTTP part. For the file writing part, you should read some
Perl documentation for file I/O for further information.
Please try to assemble something on your own first and post for advice before asking for more code given. Thanks.