---
name: "Net::Z3950::APDU"
section: "3pm"
platform: "linux"
package: "libnet-z3950-perl"
version: "0.51-2"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/Net::Z3950::APDU"
---

# Net::Z3950::APDU(3pm)

Net::Z3950::APDU - Read-only objects representing decoded Z39.50 APDUs *You probably shouldn't be reading this!*

```
        package Net::Z3950::APDU::SomeSpecificSortOfAPDU;
        use Net::Z3950::APDU;
        @ISA = qw(Net::Z3950::APDU);
        @FIELDS = qw(names of APDU fields);
```

This class provides a trivial base for the various read-only APDUs implemented as a part of the Net::Z3950 module.  Its role is simply to supply named methods providing read-only access to the same-named fields.  The set of fields is specified by the derived class's package-global `@FIELDS` array. *You don't need to understand or use this class in order to use the* *Net::Z3950 module.  It's purely an implementation detail.  In fact, I* *probably should never even have written this documentation.  Forget I* *said anything.  Go and read the next section.* The following classes are all trivial derivations of `"Net::Z3950::APDU"`, and represent specific types of APDU.  Each such class is characterised by the set of data-access methods it supplies: these are listed below. Each method takes no arguments, and returns the information implied by its name.  See the relevant sections of the Z39.50 Standard for information on the interpretation of this information - for example, section 3.2.1 (Initialization Facility) describes the elements of the `"Net::Z3950::APDU::InitResponse"` class. *Actually, you don't need to understand or use any of these classes* *either: they're used internally in the implementation, so this* *documentation is provided as a service to those who will further* *develop this module in the future.*\
 **Net::Z3950::APDU::InitResponse**

```
        referenceId()
        preferredMessageSize()
        maximumRecordSize()
        result()
        implementationId()
        implementationName()
        implementationVersion()
```

**Net::Z3950::APDU::SearchResponse**

```
        referenceId()
        resultCount()
        numberOfRecordsReturned()
        nextResultSetPosition()
        searchStatus()
        resultSetStatus()
        presentStatus()
        records()
        additionalSearchInfo()
```

**Net::Z3950::APDU::ScanResponse**

```
        referenceId()
        stepSize()
        scanStatus()
        numberOfEntriesReturned()
        positionOfTerm()
        entries()
        diag()
```

The `"diag()"` method should be consulted when `"scanStatus()"` returns 6, indicating failure; otherwise, `"entries()"` may be consulted.\
 **Net::Z3950::APDU::PresentResponse**

```
        referenceId()
        numberOfRecordsReturned()
        nextResultSetPosition()
        presentStatus()
        records()
```

**Net::Z3950::APDU::DeleteRSResponse**

```
        referenceId()
        deleteOperationStatus()
```

(We don't bother to decode the rest of this APDU at the moment, since I bet everyone calls `"Net::Z3950::ResultSet::delete()"` in void context.  If anyone wants more information out of it, we can wire it through.)\
 **Net::Z3950::APDU::Close**

```
        referenceId()
        closeReason()
        diagnosticInformation()
```

In addition, this class provides a method of no arguments, `"as_text()"`, which returns a human-readable string describing the reason for the close.\
 **Net::Z3950::APDU::NamePlusRecordList** No methods - just treat as a reference to an array of `"Net::Z3950::APDU::NamePlusRecord"`\
 **Net::Z3950::APDU::NamePlusRecord**

```
        databaseName()
        which()
        databaseRecord()
        surrogateDiagnostic()
        startingFragment()
        intermediateFragment()
        finalFragment()
```

Only one of the last five methods will return anything - you can find out which one by inspecting the return value of the `"which()"` method, which always takes one of the following values: Net::Z3950::NamePlusRecord::DatabaseRecord Net::Z3950::NamePlusRecord::SurrogateDiagnostic Net::Z3950::NamePlusRecord::StartingFragment Net::Z3950::NamePlusRecord::IntermediateFragment Net::Z3950::NamePlusRecord::FinalFragment When `"which()"` is `"Net::Z3950::NamePlusRecord::DatabaseRecord"`, the object returned from the `"databaseRecord()"` method will be a decoded Z39.50 EXTERNAL.  Its type may be any of the following (and may be tested using `"$rec->isa('Net::Z3950::Record::Whatever')"` if necessary.) Net::Z3950::Record::SUTRS Net::Z3950::Record::GRS1 Net::Z3950::Record::USMARC and similarly, Net::Z3950::Record::UKMARC, Net::Z3950::Record::NORMARC, *etc*. Net::Z3950::Record::XML Net::Z3950::Record::HTML Net::Z3950::Record::OPAC

*### others, not yet supported*\
 **Net::Z3950::APDU::SUTRS, Net::Z3950::APDU::USMARC, Net::Z3950::APDU::UKMARC, Net::Z3950::APDU::NORMARC, Net::Z3950::APDU::LIBRISMARC, Net::Z3950::APDU::DANMARC, Net::Z3950::APDU::UNIMARC, Net::Z3950::APDU::MAB** No methods - just treat as an opaque chunk of data.\
 **Net::Z3950::APDU::TaggedElement;**

```
        tagType()
        tagValue()
        tagOccurrence()
        content()
```

**Net::Z3950::APDU::ElementData**

```
        which()
        numeric()
        string()
        oid()
        subtree()
```

Only one of the last four methods will return anything - you can find out which one by inspecting the return value of the `"which()"` method, which always takes one of the following values: Net::Z3950::ElementData::Numeric Net::Z3950::ElementData::String Net::Z3950::ElementData::OID Net::Z3950::ElementData::Subtree *### others, not yet supported*\
 **Net::Z3950::APDU::HoldingsData** No methods - just treat as a reference to an array of objects, where each object is either an MARC holdings record (of type `"Net::Z3950::Record::USMARC"` or similar) or a `"Net::Z3950::APDU::HoldingsAndCirc"`\
 **Net::Z3950::APDU::HoldingsAndCirc**

```
        typeOfRecord()
        encodingLevel()
        format()
        receiptAcqStatus()
        generalRetention()
        completeness()
        dateOfReport()
        nucCode()
        localLocation()
        shelvingLocation()
        callNumber()
        shelvingData()
        copyNumber()
        publicNote()
        reproductionNote()
        termsUseRepro()
        enumAndChron()
        volumes()
        circulationData()
```

All but the last two of these have string values, although not necessarily human-readable strings.  `"volumes()"` returns a `"Net::Z3950::APDU::Volumes"` object (note the plural in the type-name), and `"circulationData()"` a `"Net::Z3950::APDU::CirculationData"`.\
 **Net::Z3950::APDU::Volumes** No methods - just treat as a reference to an array of `"Net::Z3950::APDU::Volume"` objects.\
 **Net::Z3950::APDU::HoldingsAndCirc**

```
        enumeration()
        chronology()
        enumAndChron()
```

**Net::Z3950::APDU::CirculationData** No methods - just treat as a reference to an array of `"Net::Z3950::APDU::CircRecord"` objects.\
 **Net::Z3950::APDU::HoldingsAndCirc**

```
        availableNow()
        availablityDate()
        availableThru()
        restrictions()
        itemId()
        renewable()
        onHold()
        enumAndChron()
        midspine()
        temporaryLocation()
```

**Net::Z3950::APDU::DiagRecs** No methods - just treat as a reference to an array of object references.  The objects will typically be of class `"Net::Z3950::APDU::DefaultDiagFormat"`, but careful callers will check this, since any kind of EXTERNAL may be provided instead.\
 **Net::Z3950::APDU::DefaultDiagFormat;**

```
        diagnosticSetId()
        condition()
        addinfo()
```

**Net::Z3950::APDU::OID** **No longer exists.** Previously this class had no methods - calling code just treated it as a reference to an array of integers.  However, since the only thing anyone (including `"Net::Z3950::Record::GRS1::render()"`) ever did with it was smush it up into a string with

```
        join('.', @$oidRef)
```

we now just return the dot-separated OID string *not blessed into any class* (because scalars can't be blessed - only *references* to scalars, and we don't want the extra useless level of indirection).\
 **Net::Z3950::APDU::ListEntries** No methods - just treat as a reference to an array of `"Net::Z3950::APDU::Entry"`\
 **Net::Z3950::APDU::Entry**

```
        termInfo()
        surrogateDiagnostic()
```

Usually, `"termInfo()"` returns a scanned term.  When it returns an undefined value, consult \<*surrogateDiagnostic()*\> to find out why.\
 **Net::Z3950::APDU::TermInfo**

```
        term()
        globalOccurrences()
```

*### Lots more to come here, including displayTerm*\
 **Net::Z3950::APDU::Term**

```
        general()
        numeric()
        characterString()
        oid()
        dateTime()
        external()
        integerAndUnit()
        null()
```

At present only \`\`general'' terms are supported.  The value of such a term may be obtained by calling \<*general()*\>.  Terms of other types can not be obtained.\
 **Net::Z3950::APDU::OtherInformation** No methods - just treat as a reference to an array of `"Net::Z3950::APDU::OtherInformationUnit"`\
 **Net::Z3950::APDU::OtherInformationUnit**

```
    which()
    characterInfo()
    binaryInfo()
    externallyDefinedInfo
    oid()
```

At present only \`\`externallyDefinedInfo'' units are supported.\
 **Net::Z3950::APDU::SearchInfoReport** No methods - just treat as a reference to an array of `"Net::Z3950::APDU::SearchInfoReport_s"`\
 **Net::Z3950::APDU::SearchInfoReport\_s**

```
    fullQuery()
    subqueryExpression()
    subqueryCount()
```

**Net::Z3950::APDU::QueryExpression**

```
    which()
    term()
    query()
```

At present only \`\`term'' query expressions are supported.\
 **Net::Z3950::APDU::QueryExpressionTerm**

```
    queryTerm()
```

Mike Taylor \<mike@indexdata.com\> First version Saturday 27th May 2000.
