From a2215e3f11dd630699c36b6b38bb0ecb322e98b0 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Tue, 30 Oct 2007 01:51:20 +0000 Subject: [PATCH] r1364@llin: dpavlin | 2007-10-30 02:51:21 +0100 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 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/WebPAC/Input.pm b/lib/WebPAC/Input.pm index 430d197..b3c1188 100644 --- a/lib/WebPAC/Input.pm +++ b/lib/WebPAC/Input.pm @@ -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 ), ); } -- 2.20.1