I'm trying to grab the image located here and save it in my server few times per day, just as if I "right-click" on the image and save it on my desktop. I have decided to use perl script to do this, here's what I wrote so far:
use Image::Grab;
$pic->regexp('.*\.png');
$pic->search_url('http://www.reuters.wallst.com/enhancements/chartapi/index_chart_api.asp?symbol=.SPX&headerType=quote&width=316&height=106&duration=3');
$pic->grab;
open(IMAGE, ">index_chart_api.png") || die"index_chart_api.png: $!";
binmode IMAGE; # for MSDOS derivations.
print IMAGE $pic->image;
close IMAGE;
After running it via ssh I receive this error: Can't call method "regexp" on an undefined value at line 2
Anyone has any idea what is wrong with this line "$pic->regexp('.*.png');" or how to grab and save this image (index_chart_api.png) from mentioned url on ones server properly ?
Appreciate any help with this.