7 GetOptions ("tags=s" => \@tags,
8 "infile=s" => \$infile);
9 @tags = split(/,/, join(',', @tags));
11 open(FH, $infile) or die "Can't open $infile for reading: $!";
18 # Find the Evergreen bib ID
19 $xml =~ m/<datafield tag="903".+?<subfield code="a">(.+?)<\/subfield>/;
22 # Find each occurrence of each tag specified
24 $tag{$_} = [ $xml =~ m/(<datafield tag="$_".+?<\/datafield>)/g ];
27 # Clean up the results before printing
29 foreach my $key (sort keys %tag) {
30 my $text = join("", @{$tag{$key}});
31 $text =~ s/>\s+</></g;
35 # If we found any specified tags, print what we found.
37 print "$egid\t$output\n";