Tie-Google
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
# elements of a number of searches. My "solution" (heh heh heh) is to
# store all data in a hashref, indexed into the instance as DATA; if
# the user is tieing an array or scalar (Tie::Google treats them
# identically), then we store the results in the key named $KEY, so
# that we can treat all types of ties consistently; otherwise, search
# results are keyed by query.
# ----------------------------------------------------------------------
sub new {
my ($class, $type, $KEY, $query, $options) = @_;
$options = { } unless defined $options && ref($options) eq 'HASH';
my $self = bless [ $KEY, $type, $query, $options, { }, undef, ] => $class;
# Is $KEY actually a file?
# I do this in DBD::google as well; perhaps there I should submit
# a patch to Aaron so that Net::Google can do this directly.
if (-e $KEY) {
my $fh = gensym;
open $fh, $KEY or die "Can't open keyfile $KEY for reading: $!";
chomp($KEY = <$fh>);
close $fh or die "Can't close keyfile $KEY: $!";
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.711 second using v1.00-cache-2.02-grep-82fe00e-cpan-d29e8ade9f55 )