From: Elizabeth Mattijsen Date: Wed, 10 Jul 2002 21:13:52 +0000 (+0200) Subject: [DOC PATCH] some doc nits after 17463 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=385e1f9fd66a9146b7463c05d27e5028541ba2f1;p=p5sagit%2Fp5-mst-13.2.git [DOC PATCH] some doc nits after 17463 Message-Id: <4.2.0.58.20020710211105.032546d0@mickey.dijkmat.nl> p4raw-id: //depot/perl@17470 --- diff --git a/ext/PerlIO/via/via.pm b/ext/PerlIO/via/via.pm index cab00fa..cca09d8 100644 --- a/ext/PerlIO/via/via.pm +++ b/ext/PerlIO/via/via.pm @@ -23,7 +23,7 @@ The PerlIO::via module allows you to develop PerlIO layers in Perl, without having to go into the nitty gritty of programming C with XS as the interface to Perl. -One example module, L, is include with Perl +One example module, L, is included with Perl 5.8.0, and more example modules are available from CPAN, such as L and L. The PerlIO::via::StripHTML for instance, allows you to say: diff --git a/lib/PerlIO/via/QuotedPrint.pm b/lib/PerlIO/via/QuotedPrint.pm index 3acf45c..e258830 100644 --- a/lib/PerlIO/via/QuotedPrint.pm +++ b/lib/PerlIO/via/QuotedPrint.pm @@ -1,22 +1,26 @@ package PerlIO::via::QuotedPrint; -# Make sure we do things by the book # Set the version info +# Make sure we do things by the book from now on +$VERSION = '0.04'; use strict; -$PerlIO::via::QuotedPrint::VERSION = 0.01; # Make sure the encoding/decoding stuff is available use MIME::QuotedPrint (); # no need to pollute this namespace +# Satisfy -require- + +1; + #----------------------------------------------------------------------- # IN: 1 class to bless with # 2 mode string (ignored) # 3 file handle of PerlIO layer below (ignored) # OUT: 1 blessed object -sub PUSHED { bless [],$_[0] } #PUSHED +sub PUSHED { bless \*PUSHED,$_[0] } #PUSHED #----------------------------------------------------------------------- # IN: 1 instantiated object (ignored) @@ -45,10 +49,6 @@ sub WRITE { (print {$_[2]} MIME::QuotedPrint::encode_qp($_[1])) ? length($_[1]) : -1; } #WRITE -# Satisfy -require- - -1; - __END__ =head1 NAME @@ -59,10 +59,10 @@ PerlIO::via::QuotedPrint - PerlIO layer for quoted-printable strings use PerlIO::via::QuotedPrint; - open( my $in,'Via(PerlIO::via::QuotedPrint)','file.qp' ) + open( my $out,'>:via(QuotedPrint)','file.qp' ) or die "Can't open file.qp for writing: $!\n"; =head1 DESCRIPTION @@ -73,8 +73,8 @@ from a handle, and it will encode as quoted-printable while writing to a handle. =head1 SEE ALSO -L, L, L, L, -L. +L, L, L, +L, L, L. =head1 COPYRIGHT diff --git a/pod/perldelta.pod b/pod/perldelta.pod index f43eb6c..47b6e73 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -1023,7 +1023,7 @@ C, by Elizabeth Mattijsen, is an example of a C class: use PerlIO::via::QuotedPrint; - open($fh,">Via(PerlIO::via::QuotedPrint)",$path); + open($fh,">:via(QuotedPrint)",$path); This will automatically convert everything output to C<$fh> to Quoted-Printable. See L and L. diff --git a/pod/perliol.pod b/pod/perliol.pod index 08ea7c6..6a40570 100644 --- a/pod/perliol.pod +++ b/pod/perliol.pod @@ -782,23 +782,27 @@ called thus: open( $fh, "<:encoding(iso-8859-7)", $pathname ); -=item ":Scalar" +=item ":scalar" Provides support for reading data from and writing data to a scalar. - open( $fh, ":Scalar", \$scalar ); + open( $fh, "+<:scalar", \$scalar ); When a handle is so opened, then reads get bytes from the string value of I<$scalar>, and writes change the value. In both cases the position in I<$scalar> starts as zero but can be altered via C, and determined via C. -=item ":Via" +Please note that this layer is implied when calling open() thus: + + open( $fh, "+<", \$scalar ); + +=item ":via" Provided to allow layers to be implemented as Perl code. For instance: use PerlIO::via::StripHTML; - open( my $fh, ">:Via(StripHTML)", "index.html" ); + open( my $fh, "<:via(StripHTML)", "index.html" ); See L for details.