#!/usr/bin/perl -w use strict; use utf8; use WWW::Google::Images; use DBI; use Text::Unaccent::PurePerl; my $agent; my $result; my $image; my $count; my $save_content; my $dbargs; my $text; $agent = WWW::Google::Images->new(server => 'images.google.com.br',); sub getpic{ $result = $agent->search(unac_string(shift), limit => 1); while ($image = $result->next()) { $count++; $image->save_content(base => 'image'.$count); } $count = 0; return(); } my $dbh = DBI->connect("dbi:SQLite:dbname=/my/path/.ht.sqlite","","",$dbargs); my $all = $dbh->selectall_arrayref("SELECT column FROM table"); foreach my $row (@$all) { ($text) = @$row; getpic($text); }