Listing 3. Modified Callback Routine

sub callback
{
   # Get the arguments
   my ($tag, %attributes) = @_;
   # Ignore all but hyperlinks
   return unless ($tag eq "a");
   # Indicate the tag
   print "\n\n$tag\n";
   # Iterate through each attribute, printing it
   foreach my $name (sort keys %attributes)
   {
   print "$name = $attributes{$name}\n";
   }
}