Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I'm trying to use Linkextor to pull links out of html pages on my HD. Can someone kindly point out what I'm doing wrong, as the printed array is empty.
#!/usr/bin/perl use HTML::LinkExtor; use URI::URL; if ($#ARGV != 0 ) { print "usage: linkextractorfile.pl file\n"; exit; } $file=$ARGV[0]; print "$file\n"; my $p = HTML::LinkExtor->new(); $p -> parse ($file); my @links = $p->links(); # Print them out foreach (@links) { print "$_\n"; }

Replies are listed 'Best First'.
Re: Extracting links from files
by Anonymous Monk on May 14, 2010 at 06:30 UTC
      Thank you! That was precisely what I needed.