r1364@llin: dpavlin | 2007-10-30 02:51:21 +0100
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 30 Oct 2007 01:51:20 +0000 (01:51 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 30 Oct 2007 01:51:20 +0000 (01:51 +0000)
 generelize idea a bit, and sort every subfield which has more than
 one char (and is thus "special" or wrong :-) in front.

git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@910 07558da8-63fa-0310-ba24-9fe276d99e06

lib/WebPAC/Input.pm

index 430d197..b3c1188 100644 (file)
@@ -532,17 +532,16 @@ sub stats {
 
                        if (defined($s->{sf}->{$f})) {
                                my @subfields = keys %{ $s->{sf}->{$f} };
-warn "$f has subfields ",dump( @subfields );
                                map {
                                        $o .= sprintf(" %s:%d%s", $_, 
                                                $s->{sf}->{$f}->{$_}->{count},
                                                $s->{sf}->{$f}->{$_}->{repeatable} ? '*' : '',
                                        );
                                } (
-                                       # first indicators
-                                       sort( grep(  /^i[12]$/, @subfields ) ),
-                                       # then subfileds
-                                       sort( grep( !/^i[12]$/, @subfields ) ),
+                                       # first indicators and other special subfields
+                                       sort( grep { length($_)  > 1 } @subfields ),
+                                       # then subfileds (single char)
+                                       sort( grep { length($_) == 1 } @subfields ),
                                );
                        }