Trying to parse html file

I'm trying to run a book example and I get the following error.

Can't locate HTML/ in @INC (@INC contains: E:/ind/perl/lib E:/ind/perl/
site/lib .) at E:/ind/perl/site/lib/HTML/ line 31.
BEGIN failed--compilation aborted at E:/ind/perl/site/lib/HTML/ line
Compilation failed in require at line 5.
BEGIN failed--compilation aborted at line 5.


#!e:/ind/perl/bin/perl -w

use strict;
use LWP::UserAgent;
use HTML::LinkExtor;
use URI::URL;

my $url = URI::URL->new('');
my $base_url;

# Create new UserAgent object (browser)
my $ua = LWP::UserAgent->new();

# Give our agent a name

# Create HTTP GET request
my $request = HTTP::Request->new(GET => $url);

# Execute HTTP request
my $response = $ua->request($request);

# Check success
if ($response->is_success && $response->content_type eq 'text/html') {
    # Request was successful and is html
    $base_url = $response->base();
    print "Base URL: $base_url\n";
    my $link_extor = HTML::LinkExtor->new(\&extract_links);
} else {
    # Request failed - print response code and message
    print "Error getting document: ", $response->status_line, "\n";

sub extract_links {
    my ($tag, %attr) = @_;

    if ($tag eq 'a' or $tag eq 'img') {
        foreach my $key (keys %attr) {
            if ($key eq 'href' or $key eq 'src') {
                my $link_url = URI->new($attr{$key});
                my $full_url = $link_url->abs($base_url);
                print "LINK: $full_url\n";
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Not sure of the problem. Please check whether module is in the directory E:/ind/perl/site/lib/HTML/. If not, please download from

After copy, if the problem still arise, add a line use HTML::Tagset; to the top of your source code

Thanks & Cheers

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dave CrossModule AuthorCommented:
HTML::LinkExtor uses HTML::Tagset. It seems that you've installed HTML::LinkExtor, but not HTML::Tagset.
Nothing has happened on this question in over 2 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
split points between fantasy1001 and davorg.


EE Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.