Cleanup defined.
authorRobin H. Johnson <rjohnson@sitka.bclibraries.ca>
Mon, 31 Oct 2011 19:57:31 +0000 (12:57 -0700)
committerRobin H. Johnson <rjohnson@sitka.bclibraries.ca>
Mon, 31 Oct 2011 19:57:31 +0000 (12:57 -0700)
marc_export_custom/marc_export_custom

index 21679c2..604d75c 100755 (executable)
@@ -243,14 +243,13 @@ sub export_record {
         if ($type eq 'biblio') {
             # Remove old 852 fields
             my @f = $r->field('852');
-            $r->delete_fields(@f) if defined @f;
-            undef @f;
+            $r->delete_fields(@f) if @f;
             # Add new 852 fields 
             add_bib_holdings($bib, $r);
             # Check that at least one 852 was added
-            my @f = $r->field('852');
+            @f = $r->field('852');
             # If not, we should NOT add this item to the export 
-            return unless defined @f;
+            return unless @f;
         }
 
         if($force901){