8.172. PerlIO::ViaA helper class for PerlIO layers implemented in Perl. PerlIO::Via ships with the Perl 5.8 source kit. For example, you can use PerlIO::Via to call MIME::Base64::encode_base64() via open(): #!/usr/local/bin/perl -w; use MIME::Base64; open(my $fh, ">Via(MIME::Base64)", "encode_base64"); PerlIO::Via implements the following methods.
CLOSE(fh) Returns 0 on success and -1 on error.
EOF(fh) Returns end-of-file state. The default behavior is to return a value of FILL() or READ().
ERROR(fh) Returns error state.
FILENO(fh) Returns a numeric value that represents the Unix-like file descriptor, or -1 if no file descriptor exists.
FILL(fh) Returns a string that will be placed in the buffer.
FLUSH(fh) Flushes any buffered write data. Returns 0 on success and -1 on error.
POPPED([fh]) Removes a layer from PerlIO::Via.
$class->PUSHED([mode [,fh]]) Returns an object or the class, or -1 on failure. PUSHED takes optional arguments for file open mode—r, w, w+, etc.—and takes a mandatory filehandle for the PerlIO layer itself.
READ(buffer, len, fh) Returns the number of octets in buffer, which must be less than or equal to len.
SEEK(posn, where, fh) Returns 0 on success and -1 on error.
TELL(fh) Returns the file position, without an available default.
UNREAD(buffer, fh) Returns the number of octets from bufferthat have been successfully saved. Copyright © 2002 O'Reilly & Associates. All rights reserved. |
|