From: Dobrica Pavlinusic Date: Tue, 6 Nov 2007 20:06:07 +0000 (+0000) Subject: correctly upgrade repeatable field value to array X-Git-Url: http://git.rot13.org/?p=MARC-Fast;a=commitdiff_plain;h=8ddb954243aacc37ee72801b9f1d969d893a5f85 correctly upgrade repeatable field value to array git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/MARC-Fast/trunk@24 49f9634a-d7ec-0310-8e6b-ec35c6cc8804 --- diff --git a/Fast.pm b/Fast.pm index aa510ba..ace03b3 100644 --- a/Fast.pm +++ b/Fast.pm @@ -336,7 +336,7 @@ sub to_hash { # repeatable subfiled -- convert it to array if ($val->{$f}) { - if ( $sf_usage->{$f} == 2 ) { + if ( ref($val->{$f}) ne 'ARRAY' ) { $val->{$f} = [ $val->{$f}, $val ]; } else { push @{$val->{$f}}, $val;