UPDATE: For those who may be crossing in the same shadows, while no Monk gives His/Her wisdom, I'm going to look for green land at REST::Google::Search.
Dear Honorable Monks,
I'm trying to "shift" SELECTed strings to a function where $result = $foo->bar(shift), but nothing happens. Foreach works fine; I can print the strings from the database. Calling getpic('some arbitrary utf8') also works well. But together the couple doesn't get married. Some help?
#!/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);
}
also works well. But together the couple doesn