Hello wiseones..

I am a newbie to perl and am wrestling with the Image::Grab module. I have got it working fine to grab the images that i want but, I am trying to workout how to use the Date and MD5 options. Having read the info on CPAN, elsewhere and doing a super search here.. I am still none the wiser. Here is my code..

#!/usr/bin/perl -w use strict; use Image::Grab; my $image = new Image::Grab; $image->url('http://www.mysite.com/my.jpg'); $image->grab_new;

# save image bit here

I can see that i can use $image->date to see the date info for the file, which is in epochtime. Do I compare this with my local time or am i completely barking up the wrong tree?

I would like to run script as a cronjob and only get the image if it has been updated. I have the MD5 module installed.

Any advice would be appreciated, i know i still have alot to learn grasshopper! :o)

Linux MDK9.0::Perl 5.8.0::Image::Grab 1.4


In reply to newbie quest for Image::Grab by lone5ive

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.