Listing 2. Simple Callback Routine

sub callback
{
   # Get the arguments
   my ($tag, %attributes) = @_;
   # 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";
   }
}