#!/usr/bin/perl

# Extract all url's from an html file


use HTML::LinkExtor;

$parser=HTML::LinkExtor->new(undef, $base_url);
$parser->parser_file($filename);
@links = $parser->links;

foreach $linkaray (@links){
  print @$linkarray;
  my @element=@$linkarray;
  my $elt_type=shift @element;   # element type
  
  #possibly test if this is an element we're interested in
  while (@element){
    # extract the next attribute and it's value
    my ($attr_name, $attr_value) = splice(@element, 0, 2);
    print @element;
  }
}
