ext/PerlIO/Scalar/Makefile.PL PerlIO layer for scalars
ext/PerlIO/Scalar/Scalar.pm PerlIO layer for scalars
ext/PerlIO/Scalar/Scalar.xs PerlIO layer for scalars
-ext/PerlIO/t/encoding.t See if PerlIo encoding conversion works
-ext/PerlIO/t/scalar.t Test of PerlIO::Scalar
+ext/PerlIO/t/encoding.t See if PerlIO encoding conversion works
+ext/PerlIO/t/scalar.t See if PerlIO::Scalar works
+ext/PerlIO/t/via.t See if PerlIO::Via works
ext/PerlIO/Via/Makefile.PL PerlIO layer for layers in perl
ext/PerlIO/Via/Via.pm PerlIO layer for layers in perl
ext/PerlIO/Via/Via.xs PerlIO layer for layers in perl
a reference to a glob which can be treated as a perl file handle.
It refers to the layer below. I<$fh> is not passed if the layer
is at the bottom of the stack, for this reason and to maintain
-some level of "compatibility" with TIEHANDLE classes it is passed
-last.
+some level of "compatibility" with TIEHANDLE classes it is passed last.
+
+As an example, in Perl release 5.8.0 the MIME::QuotedPrint module
+defines the required TIEHANDLE methods so that you can say
+
+ use MIME::QuotedPrint;
+ open(my $fh, ">Via(MIME::QuotedPrint)", "qp");
=over 4
--- /dev/null
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ unless (find PerlIO::Layer 'perlio') {
+ print "1..0 # Skip: not perlio\n";
+ exit 0;
+ }
+}
+
+my $tmp = "via$$";
+
+print "1..3\n";
+
+$a = join("", map { chr } 0..255) x 10;
+
+use MIME::QuotedPrint;
+open(my $fh,">Via(MIME::QuotedPrint)", $tmp);
+print $fh $a;
+close($fh);
+print "ok 1\n";
+
+open(my $fh,"<Via(MIME::QuotedPrint)", $tmp);
+{ local $/; $b = <$fh> }
+close($fh);
+print "ok 2\n";
+
+print "ok 3\n" if $a eq $b;
+
+END {
+ 1 while unlink $tmp;
+}