Note that if you call warnings() on a MARC::Record object the internal list
of warnings is cleared, so if you call it a second time for the same object
you'll get nothing.


Mike O'Regan



                                                                                       
                                             
                      Ed Summers                                                       
                                             
                      <[EMAIL PROTECTED]>          To:       [EMAIL PROTECTED]         
                                                 
                                               cc:                                     
                                             
                      10/21/2003 11:30         Subject:  Re: testing invalid iso2709 
files                                          
                      AM                                                               
                                             
                                                                                       
                                             
                                                                                       
                                             




On Tue, Oct 21, 2003 at 06:21:31PM +0200, paul POULAIN wrote:
> other question : how works ->warnings ?
> I tried $marcrecord->warnings(), but I only get a number.

how about in list context?

    @warnings = $record->warnings();

This should have been more clear in the docs (which are now updated...in
cvs).

The reason why warnings() returns a list is that a given record could have
multiple warnings. When you assign to a scalar in list context you get the
amount of items in the list, which is why you got a number.

It can be a handy trick sometimes:

    my $count = @items; ## number of items in @items

//Ed





Reply via email to