FEAR::API FEAR::API - There's no fear with this elegant site scraper #8

Example 2 rewrite

Old

use WWW::Mechanize;
use Data::Dumper;
my $mech = WWW::Mechanize->new();
$mech->get( "http://google.com" );
my @link;
foreach ($mech->links){
    if($_->[0] =~ /foo/){
       $mech->get($_->[0]);
    }
    elsif($_->[0] =~ /bar/){
       push @link;
    }
}
print Dumper \@link;
continued...
Copyright © 2006 Yung-chung Lin