I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2009-04-17 15:47:04-07 by nigelhorne
links method returns a list of blanks
OK I give up what's wrong with this program? It prints a warning, then it prints 4 lines of "link:" without showing the link, then the 4 lines with the hrefs. It's as though the links method returns a list of blanks:
#!/usr/bin/perl -wT use strict; use diagnostics; use warnings; use HTML::SimpleLinkExtor; my $html = '<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"> <HTML> <BODY> <A HREF="http://www.google.com">Google</A> <A HREF="http://www.example.com">Example</A> <A HREF="http://www.bandsman.co.uk">Bandsman</A> <A HREF="http://www.concert-bands.co.uk">Concert Bands</A> </BODY> </HTML> '; my $base = "http://www.bandsman.co.uk/band-links.htm"; my $extor = HTML::SimpleLinkExtor->new($base); unless($extor) { print "no links found\n"; exit; } $extor->parse($html); foreach ($extor->links) { print "link: " . $_ . "\n"; } foreach ($extor->a) { print "href: " . $_ . "\n"; }
Direct Responses: Write a response