The following code iterates unexpectedly. I want to
loop thru the file 'file.dat' and pull out every field
that begins with 650. The code then pulls the 650
field and builds an array from the sub-fields.
The code works but I'm stuck on the first record.
In other words if the file I'm reading has 2000
records I get the first 650 record 2000X

thanks




     ## Example R6
      
      use MARC::Batch;
      my $batch
=MARC::Batch->new('USMARC','file.dat');
      my $record = $batch->next();
      
      ## get all the 650 fields (list context).
      my @fields = $record->field('852');
      
     ## examine each 650 field and print it out.
     

while (my $record = $batch->next())
{     
      
       
      
      
           foreach my $field (@fields) {
       print $field->as_string(),"\n";
     }
}


re-v


        
                
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to