GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MARC::File(3) User Contributed Perl Documentation MARC::File(3)

MARC::File - Base class for files of MARC records

    use MARC::File::USMARC;

    # If you have weird control fields...
    use MARC::Field;
    MARC::Field->allow_controlfield_tags('FMT', 'LDX');    

    my $file = MARC::File::USMARC->in( $filename );

    while ( my $marc = $file->next() ) {
        # Do something
    }
    $file->close();
    undef $file;

None.

Opens a file for import. Ordinarily you will use "MARC::File::USMARC" or "MARC::File::MicroLIF" to do this.

    my $file = MARC::File::USMARC->in( 'file.marc' );

Returns a "MARC::File" object, or "undef" on failure. If you encountered an error the error message will be stored in $MARC::File::ERROR.

Optionally you can also pass in a filehandle, and "MARC::File". will "do the right thing".

    my $handle = IO::File->new( 'gunzip -c file.marc.gz |' );
    my $file = MARC::File::USMARC->in( $handle );

Reads the next record from the file handle passed in.

The $filter_func is a reference to a filtering function. Currently, only USMARC records support this. See MARC::File::USMARC's "decode()" function for details.

Returns a MARC::Record reference, or "undef" on error.

Skips over the next record in the file. Same as "next()", without the overhead of parsing a record you're going to throw away anyway.

Returns 1 or undef.

Simlilar to the methods in MARC::Record and MARC::Batch, "warnings()" will return any warnings that have accumulated while processing this file; and as a side-effect will clear the warnings buffer.

Closes the file, both from the object's point of view, and the actual file.

Writes a record to the output file. This method must be overridden in your subclass.

Decodes a record into a USMARC format. This method must be overridden in your subclass.

MARC::Record

"out()" method

We only handle files for input right now.

This code may be distributed under the same terms as Perl itself.

Please note that these modules are not products of or supported by the employers of the various contributors to the code.

Andy Lester, "<andy@petdance.com>"
2017-05-24 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.