blob: 2bd2a314f37391d0ecb39bf9930d9fb334aa8c51 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
my $this; my %elts; sub process { my $data = shift; my $key; $data =~ m@\s+(U[[:xdigit:]]+)\s+@; $key=$1; if ($elts{$key}) { print STDERR "Warning: key $key found more than once.\n"; } $elts{$key}=$data; } while (<>) { if (/(?:###\+)?<MM>/) { while (/(?:###\+)?<MM>/) { $this .= $_; $_ = <>; } process $this; $this=''; } $this .= $_; } for $k (sort keys %elts) { print $elts{$k}; }
|