summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-06-12 22:56:24 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-06-12 22:56:24 +0000
commitae258fbbee1d7d335bde126dcfa7410083bdbd53 (patch)
tree2ae7d39847a2103e80fa647287d54a160bc84b96
parent307ea6df8c2001c2fa231e383f56d2397009a9e8 (diff)
downloadperl-ae258fbbee1d7d335bde126dcfa7410083bdbd53.tar.gz
Mention I/O layers in perlopentut.
p4raw-id: //depot/perl@17209
-rw-r--r--pod/perlopentut.pod36
1 files changed, 36 insertions, 0 deletions
diff --git a/pod/perlopentut.pod b/pod/perlopentut.pod
index 34405639f4..6f7f77c432 100644
--- a/pod/perlopentut.pod
+++ b/pod/perlopentut.pod
@@ -838,6 +838,42 @@ how to increment a number in a file safely:
close(FH)
or die "can't close numfile: $!";
+=head2 IO Layers
+
+In Perl 5.8.0 a new I/O framework called "PerlIO" was introduced.
+This is a new "plumbing" for all the I/O happening in Perl; for the
+most part everything will work just as it did, but PerlIO brought in
+also some new features, like the capability of think of I/O as "layers".
+One I/O layer may in addition to just moving the data also do
+transformations on the data. Such transformations may include
+compression and decompression, encryption and decryption, and transforming
+between various character encodings.
+
+Full discussion about the features of PerlIO is out of scope for this
+tutorial, but here is how to recognize the layers being used:
+
+=over 4
+
+=item *
+
+The three-(or more)-argument form of C<open()> is being used and the
+second argument contains something else in addition to the usual
+C<< '<' >>, C<< '>' >>, C<< '>>' >>, C<< '|' >> and their variants,
+for example:
+
+ open(my $fh, "<:utf8", $fn);
+
+=item *
+
+The two-argument form of C<binmode<open()> is being used, for example
+
+ binmode($fh, ":encoding(utf16)");
+
+=back
+
+For more detailed discussion about PerlIO see L<perlio>;
+for more detailed discussion about Unicode and I/O see L<perluniintro>.
+
=head1 SEE ALSO
The C<open> and C<sysopen> function in perlfunc(1);