[TriLUG] Perl LinkExtor

Scott Lundgren s_l at mindspring.com
Sun Dec 7 16:57:59 EST 2003


Josh,

Watch your variable names. In line 11 you declare the variable $LinxEx with
an x. In line 13 you try to use a variable called LinkEx with a k. Of course
the compiler complains because it has no idea where this variable came from.
BTW: Notice you try to use LinkEx with an E in line 15.

Fix those and it runs fine. ;)

- SL

1use LWP::Simple;
2use HTML::LinkExtor;
3use Data::Dumper;
4
5my $url = 'http://some.web.site';
6
7my $content = get $url;
8
9print("fetched $url\n");
10
11my $LinxEx = HTML::LinkExtor->new();
12
13$LinkEx->parse($content);
14
15print Dumper($LinkEX->links);




More information about the TriLUG mailing list