1use strict;
2
3my $count = 0;
4my $skip = 0;
5
6while(<DATA>) {
7    next if /^\s+/;
8
9    if ($skip) {
10       $skip=0;
11       next;
12    }
13
14    $count++ if /^&#/;
15    $count++ if /^&\w/;
16    # print "$count: ";
17    print;
18    if($count == 2) {
19       $count = 0;
20       print "\n";
21       $skip = 1;
22    }
23
24
25}
26# print $count, "\n";
27
28__DATA__
29"
30&#34;
31&quot;
32quotation mark
33
34'
35&#39;
36&apos;
37apostrophe 
38
39&
40&#38;
41&amp;
42ampersand
43
44<
45&#60;
46&lt;
47less-than
48
49>
50&#62;
51&gt;
52greater-than
53
54¡
55&#161;
56&iexcl;
57inverted exclamation mark
58
59¢
60&#162;
61&cent;
62cent
63
64£
65&#163;
66&pound;
67pound
68
69¤
70&#164;
71&curren;
72currency
73
74¥
75&#165;
76&yen;
77yen
78
79¦
80&#166;
81&brvbar;
82broken vertical bar
83
84§
85&#167;
86&sect;
87section
88
89¨
90&#168;
91&uml;
92spacing diaeresis
93
94©
95&#169;
96&copy;
97copyright
98
99ª
100&#170;
101&ordf;
102feminine ordinal indicator
103
104«
105&#171;
106&laquo;
107angle quotation mark (left)
108
109¬
110&#172;
111&not;
112negation
113­
114&#173;
115&shy;
116soft hyphen
117
118®
119&#174;
120&reg;
121registered trademark
122
123¯
124&#175;
125&macr;
126spacing macron
127
128°
129&#176;
130&deg;
131degree
132
133±
134&#177;
135&plusmn;
136plus-or-minus 
137
138²
139&#178;
140&sup2;
141superscript 2
142
143³
144&#179;
145&sup3;
146superscript 3
147
148´
149&#180;
150&acute;
151spacing acute
152
153µ
154&#181;
155&micro;
156micro
157
158
159&#182;
160&para;
161paragraph
162
163·
164&#183;
165&middot;
166middle dot
167
168¸
169&#184;
170&cedil;
171spacing cedilla
172
173¹
174&#185;
175&sup1;
176superscript 1
177
178º
179&#186;
180&ordm;
181masculine ordinal indicator
182
183»
184&#187;
185&raquo;
186angle quotation mark (right)
187
188¼
189&#188;
190&frac14;
191fraction 1/4
192
193½
194&#189;
195&frac12;
196fraction 1/2
197
198¾
199&#190;
200&frac34;
201fraction 3/4
202
203¿
204&#191;
205&iquest;
206inverted question mark
207
208×
209&#215;
210&times;
211multiplication
212
213÷
214&#247;
215&divide;
216division
217
218&#8704;
219&forall;
220for all
221
222
223&#8706;
224&part;
225part
226
227
228&#8719;
229&prod;
230prod
231
232
233&#8721;
234&sum;
235sum
236
237
238&#8722;
239&minus;
240minus
241
242
243&#8734;
244&infin;
245infinity
246
247
248&#8745;
249&cap;
250cap
251
252
253&#8747;
254&int;
255integral
256
257
258&#8776;
259&asymp;
260almost equal
261
262
263&#8800;
264&ne;
265not equal
266
267&#8801;
268&equiv;
269equivalent
270
271&#8804;
272&le;
273less or equal
274
275&#8805;
276&ge;
277greater or equal
278
279
280Α
281&#913;
282&Alpha;
283Alpha
284
285Β
286&#914;
287&Beta;
288Beta
289
290Γ
291&#915;
292&Gamma;
293Gamma
294
295Δ
296&#916;
297&Delta;
298Delta
299
300Ε
301&#917;
302&Epsilon;
303Epsilon
304
305Ζ
306&#918;
307&Zeta;
308Zeta
309
310Η
311&#919;
312&Eta;
313Eta
314
315Θ
316&#920;
317&Theta;
318Theta
319
320Ι
321&#921;
322&Iota;
323Iota
324
325Κ
326&#922;
327&Kappa;
328Kappa
329
330Λ
331&#923;
332&Lambda;
333Lambda
334
335Μ
336&#924;
337&Mu;
338Mu
339
340Ν
341&#925;
342&Nu;
343Nu
344
345Ξ
346&#926;
347&Xi;
348Xi
349
350Ο
351&#927;
352&Omicron;
353Omicron
354
355Π
356&#928;
357&Pi;
358Pi
359
360Ρ
361&#929;
362&Rho;
363Rho
364
365Σ
366&#931;
367&Sigma;
368Sigma
369
370Τ
371&#932;
372&Tau;
373Tau
374
375Υ
376&#933;
377&Upsilon;
378Upsilon
379
380Φ
381&#934;
382&Phi;
383Phi
384
385Χ
386&#935;
387&Chi;
388Chi
389
390Ψ
391&#936;
392&Psi;
393Psi
394
395Ω
396&#937;
397&Omega;
398Omega
399 
400α
401&#945;
402&alpha;
403alpha
404
405β
406&#946;
407&beta;
408beta
409
410γ
411&#947;
412&gamma;
413gamma
414
415δ
416&#948;
417&delta;
418delta
419
420ε
421&#949;
422&epsilon;
423epsilon
424
425ζ
426&#950;
427&zeta;
428zeta
429
430η
431&#951;
432&eta;
433eta
434
435θ
436&#952;
437&theta;
438theta
439
440ι
441&#953;
442&iota;
443iota
444
445κ
446&#954;
447&kappa;
448kappa
449
450λ
451&#955;
452&lambda;
453lambda
454
455μ
456&#956;
457&mu;
458mu
459ν
460&#957;
461&nu;
462nu
463ξ
464&#958;
465&xi;
466xi
467ο
468&#959;
469&omicron;
470omicron
471π
472&#960;
473&pi;
474pi
475ρ
476&#961;
477&rho;
478rho
479ς
480&#962;
481&sigmaf;
482sigmaf
483σ
484&#963;
485&sigma;
486sigma
487τ
488&#964;
489&tau;
490tau
491υ
492&#965;
493&upsilon;
494upsilon
495φ
496&#966;
497&phi;
498phi
499χ
500&#967;
501&chi;
502chi
503ψ
504&#968;
505&psi;
506psi
507ω
508&#969;
509&omega;
510omega
511
512Œ
513&#338;
514&OElig;
515capital ligature OE
516œ
517&#339;
518&oelig;
519small ligature oe
520Š
521&#352;
522&Scaron;
523capital S with caron
524š
525&#353;
526&scaron;
527small S with caron
528Ÿ
529&#376;
530&Yuml;
531capital Y with diaeres
532ƒ
533&#402;
534&fnof;
535f with hook
536ˆ
537&#710;
538&circ;
539modifier letter circumflex accent
540˜
541&#732;
542&tilde;
543small tilde
544
545&#8204;
546&zwnj;
547zero width non-joiner
548
549&#8205;
550&zwj;
551zero width joiner
552
553&#8206;
554&lrm;
555left-to-right mark
556
557&#8207;
558&rlm;
559right-to-left mark
560
561
562&#8211;
563&ndash;
564en dash
565
566
567&#8212;
568&mdash;
569em dash
570
571
572&#8216;
573&lsquo;
574left single quotation mark
575
576
577&#8217;
578&rsquo;
579right single quotation mark
580
581
582&#8218;
583&sbquo;
584single low-9 quotation mark
585
586
587&#8220;
588&ldquo;
589left double quotation mark
590
591
592&#8221;
593&rdquo;
594right double quotation mark
595
596
597&#8222;
598&bdquo;
599double low-9 quotation mark
600
601
602&#8224;
603&dagger;
604dagger
605
606
607&#8225;
608&Dagger;
609double dagger
610
611
612&#8226;
613&bull;
614bullet
615
616
617&#8230;
618&hellip;
619horizontal ellipsis
620
621
622&#8240;
623&permil;
624per mille 
625
626
627&#8242;
628&prime;
629minutes
630
631
632&#8243;
633&Prime;
634seconds
635
636
637&#8249;
638&lsaquo;
639single left angle quotation
640
641
642&#8250;
643&rsaquo;
644single right angle quotation
645
646
647&#8254;
648&oline;
649overline
650
651
652&#8364;
653&euro;
654euro
655
656
657&#8482;
658&trade;
659trademark
660
661
662&#8592;
663&larr;
664left arrow
665
666
667&#8593;
668&uarr;
669up arrow
670
671
672&#8594;
673&rarr;
674right arrow
675
676
677&#8595;
678&darr;
679down arrow
680
681
682&#8596;
683&harr;
684left right arrow
685
686
687&#9674;
688&loz;
689lozenge
690
691
692&#9824;
693&spades;
694spade
695
696
697&#9827;
698&clubs;
699club
700
701
702&#9829;
703&hearts;
704heart
705
706
707&#9830;
708&diams;
709diamond
710
711
712