"Mike Blezien" schreef:

>   my $article_number = $elt->first_child_text('article_number');
>   my $dist_number    = $elt->first_child_text('distributor_number');
>   my $dist_name      = $elt->first_child_text('distributor_name');
>   my $artist         = $elt->first_child_text('artist');
>   my $ean_upc        = $elt->first_child_text('ean_upc');
>   my $set_total      = $elt->first_child_text('set_total');

That looks awful. Isn't there some way with the module to do it cleaner?

Or do it more like:

  my @text_tags = qw(article_number distributor_number etc);
  my %data;

  for my $tag (@text_tags) {
      $data{_text}{$tag} = $elt->first_child_text($tag);
  }


You may also want a %tag2caption, like:

  my %tag2caption = (
      number_of_tracks => 'tracknums',
  );

to be able to print a nicer text (or even translation) for a tag.
Print as-is all the tag-names that don't have an alias, after maybe
replacing each underscore by a space.

-- 
Affijn, Ruud

"Gewoon is een tijger."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to