From: Gurusamy Sarathy Date: Sat, 28 Nov 1998 17:47:48 +0000 (+0000) Subject: update tie() entry in perlfunc to reflect TIEARRAY and TIEHANDLE X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8a0597442b89a0a3330c57701574531c2f5c7b15;p=p5sagit%2Fp5-mst-13.2.git update tie() entry in perlfunc to reflect TIEARRAY and TIEHANDLE p4raw-id: //depot/perl@2359 --- diff --git a/lib/Tie/Handle.pm b/lib/Tie/Handle.pm index c755053..3cf94ec 100644 --- a/lib/Tie/Handle.pm +++ b/lib/Tie/Handle.pm @@ -65,6 +65,10 @@ Read a single line Get a single character +=item CLOSE this + +Close the handle + =item DESTROY this Free the storage associated with the tied handle referenced by I. diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 265aad4..58d372a 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -4145,11 +4145,11 @@ This function binds a variable to a package class that will provide the implementation for the variable. VARIABLE is the name of the variable to be enchanted. CLASSNAME is the name of a class implementing objects of correct type. Any additional arguments are passed to the "C" -method of the class (meaning C, C, or C). -Typically these are arguments such as might be passed to the C -function of C. The object returned by the "C" method is also -returned by the C function, which would be useful if you want to -access other methods in CLASSNAME. +method of the class (meaning C, C, C, +or C). Typically these are arguments such as might be passed +to the C function of C. The object returned by the "C" +method is also returned by the C function, which would be useful +if you want to access other methods in CLASSNAME. Note that functions such as C and C may return huge lists when used on large objects, like DBM files. You may prefer to use the @@ -4166,28 +4166,52 @@ C function to iterate over such. Example: A class implementing a hash should have the following methods: TIEHASH classname, LIST - DESTROY this FETCH this, key STORE this, key, value DELETE this, key + CLEAR this EXISTS this, key FIRSTKEY this NEXTKEY this, lastkey + DESTROY this A class implementing an ordinary array should have the following methods: TIEARRAY classname, LIST - DESTROY this FETCH this, key STORE this, key, value - [others TBD] + FETCHSIZE this + STORESIZE this, count + CLEAR this + PUSH this, LIST + POP this + SHIFT this + UNSHIFT this, LIST + SPLICE this, offset, length, LIST + EXTEND this, count + DESTROY this + +A class implementing a file handle should have the following methods: + + TIEHANDLE classname, LIST + READ this, scalar, length, offset + READLINE this + GETC this + WRITE this, scalar, length, offset + PRINT this, LIST + PRINTF this, format, LIST + CLOSE this + DESTROY this A class implementing a scalar should have the following methods: TIESCALAR classname, LIST - DESTROY this FETCH this, STORE this, value + DESTROY this + +Not all methods indicated above need be implemented. See L, +L, L, L and L. Unlike C, the C function will not use or require a module for you--you need to do that explicitly yourself. See L