[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Glue and Sherlock



Just a little snippet for y'all:

  #!perl -wl
  use Mac::Glue::Sherlock;
  $s = new Mac::Glue::Sherlock;
  @results = $s->search_Internet(
    ['Yahoo!', 'AltaVista'], {'for'=>'MacPerl', _reply=>1})->get;

  foreach (sort @results) {
    $c++, print if /ptf/i;
  }
  printf "%d of %d matches are from PTF.\n", $c, scalar @results;
  $s->quit;

Returns:

  http://www.ptf.com/MacPerl/ptf_book/cdrom.html
  http://www.ptf.com/macperl/
  http://www.ptf.com/macperl/depts/Stories/
  http://www.ptf.com/macperl/depts/articles/IPCwMP.html
  http://www.ptf.com/macperl/forms/feedback.html
  http://www.ptf.com/macperl/ptf_book/

  6 of 20 matches are from PTF.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])