孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

#!/usr/bin/perl -w
use File::Temp qw(tempdir);
use File::Spec::Functions;
use LWP::Simple qw(getstore);

my ($temp_dir)=tempdir(CLEARUP => 1);
my %searches = (
    google =>'http://www.google.com/#h1=en&q=perl',
    yahoo => 'http://search.yahoo.com/search?p=perl',
    microsoft => 'http://www.bing.com/search?q=perl',
);


foreach my $search (keys %searches) {
    getstore($searches{$search},catfile($temp_dir,$search));
}

posted on 2012-09-28 22:11  孤独的猫  阅读(301)  评论(0编辑  收藏  举报