A 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 |
Returns 0 on success and -1 on error.
EOF |
Returns end-of-file state. The default behavior is to return a value of FILL() or READ().
ERROR |
Returns error state.
FILENO |
Returns a numeric value that represents the Unix-like file descriptor, or -1 if no file descriptor exists.
FILL |
Returns a string that will be placed in the buffer.
FLUSH |
Flushes any buffered write data. Returns 0 on success and -1 on error.
POPPED |
Removes a layer from PerlIO::Via.
PUSHED |
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 |
Returns the number of octets in buffer, which must be less than or equal to len.
SEEK |
Returns 0 on success and -1 on error.
TELL |
Returns the file position, without an available default.
UNREAD |
Returns the number of octets from bufferthat have been successfully saved.
WRITE |
Returns the number of octets in buffer that have been written.
8.171. PerlIO::Scalar | 8.173. Pod::Functions |
Copyright © 2002 O'Reilly & Associates. All rights reserved.