The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
package Fetcher;
use strict;
use Carp;
#ץȡָ¶¨Á´½Ó£¬·µ»ØÄÚÈÝ»òÕß¿Õ
sub fetch{
    my $class = shift ;
    my $seed  = shift || Carp->croak("ÐèÒªseed¡£¡£¡£¡£¡£");
    use LWP::UserAgent;
    use HTML::Tree;
    my $ua = LWP::UserAgent->new;
    $ua->agent("MyApp/0.1 ");
    ###¶à¸öÍøÕ¾####µÃÑо¿ÍøÕ¾µÄ½á¹¹£¬±éÀúÊ÷£¬¹Ø¼ü´Ê¹ýÂË¡£
    # Create a request
    my $req = HTTP::Request->new(GET => $seed);
    # Pass request to the user agent and get a response back
    my $res = $ua->request($req);
    # Check the outcome of the response
    if ($res->is_success) {
        my $content =  $res->content;
        return $content;
    }
    else {
        #print $res->status_line, "\n";
        return undef;
    }
}
1;