fernandes has asked for the wisdom of the Perl Monks concerning the following question:
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?
also works well. But together the couple doesn#!/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); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Lite SELECTed strings don't like to be with Sir WWW::Google::Images
by Corion (Patriarch) on Feb 21, 2012 at 08:14 UTC | |
by fernandes (Monk) on Feb 21, 2012 at 20:53 UTC |