#!/usr/bin/perl # Notice. No warnings. Sigh! use strict; use DBI; my $query = "@ARGV" || "PerlMonks"; my $sql = qq{ SELECT title, URL FROM google WHERE q = "$query" }; my $dbh = DBI->connect("dbi:google:", (glob "~/.googlekey"), undef, {RaiseError=>1, lr=>['en'], oe=>'utf-8', ie=>'utf-8'}); for (@{$dbh->selectall_arrayref($sql)}) { print "Title ", $_->[0], "\n", "URL ", $_->[1], "\n\n"; } $dbh->disconnect(); #### _ _ _ _ (_|| | |(_|>< _|