I dreamed to study Pearl for quite a long time, but I still could not. But the other day I gathered all my resolve and sat down at the manual. Naturally, the task needed to be solved was needed, and it was found. There is a wonderful magazine TimeOut, and on its website, flyers for free film screenings are periodically distributed. The only drawback is that you cannot subscribe to these distributions, that is, no one will send the invitation to the movie free of charge by mail. This is the inconvenience I decided to fix. Pictures with flyers on the timeout site look like vkino.timeout.ru/pix/XXXXX.jpeg , where XXXXX is the number of the flyer. The numbers are in order, that is, the task is to periodically check whether a new picture has appeared. If a picture has appeared, it is downloaded to the server, where a thumbnail is made from it, and is sent to specific addresses. The numbers of downloaded pictures, as well as email addresses, are stored in text files. Runs on the crown.
Actually, the code:
#!/usr/bin/perl use LWP::Simple; use MIME::Lite; use GD;