summaryrefslogtreecommitdiff
path: root/cpan/PerlIO-via-QuotedPrint
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2012-06-08 13:42:18 +0100
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2012-06-17 21:26:49 +0100
commit7e2869600adaf0427b85b738262783df82429569 (patch)
tree5096b1fdb1ca012c9361e2b7c70fac244e54ada4 /cpan/PerlIO-via-QuotedPrint
parent8114efa073c94fe6d21f4dd37d10822583986fc2 (diff)
downloadperl-7e2869600adaf0427b85b738262783df82429569.tar.gz
Updated PerlIO-via-QuotedPrint to CPAN version 0.07
[DELTA] 0.07 5 April 2012 Brought up to date with current code esthetics. Verified it runs on 5.14.2, threaded and unthreaded. 28 January 2004 Made sure the test-suite cleans up on multi-versioned systems.
Diffstat (limited to 'cpan/PerlIO-via-QuotedPrint')
-rw-r--r--cpan/PerlIO-via-QuotedPrint/lib/PerlIO/via/QuotedPrint.pm56
-rw-r--r--cpan/PerlIO-via-QuotedPrint/t/QuotedPrint.t18
2 files changed, 34 insertions, 40 deletions
diff --git a/cpan/PerlIO-via-QuotedPrint/lib/PerlIO/via/QuotedPrint.pm b/cpan/PerlIO-via-QuotedPrint/lib/PerlIO/via/QuotedPrint.pm
index 2434191f09..11ba2e7b4f 100644
--- a/cpan/PerlIO-via-QuotedPrint/lib/PerlIO/via/QuotedPrint.pm
+++ b/cpan/PerlIO-via-QuotedPrint/lib/PerlIO/via/QuotedPrint.pm
@@ -1,20 +1,21 @@
package PerlIO::via::QuotedPrint;
-# Set the version info
-# Make sure we do things by the book from now on
+$VERSION= '0.07';
-$VERSION = '0.06';
+# be as strict as possible
use strict;
-# Make sure the encoding/decoding stuff is available
-
+# modules that we need
use MIME::QuotedPrint (); # no need to pollute this namespace
-# Satisfy -require-
-
+# satisfy -require-
1;
-#-----------------------------------------------------------------------
+#-------------------------------------------------------------------------------
+#
+# Standard Perl features
+#
+#-------------------------------------------------------------------------------
# IN: 1 class to bless with
# 2 mode string (ignored)
# 3 file handle of PerlIO layer below (ignored)
@@ -22,21 +23,21 @@ use MIME::QuotedPrint (); # no need to pollute this namespace
sub PUSHED { bless \*PUSHED,$_[0] } #PUSHED
-#-----------------------------------------------------------------------
+#-------------------------------------------------------------------------------
# IN: 1 instantiated object (ignored)
# 2 handle to read from
# OUT: 1 decoded string
sub FILL {
-# Read the line from the handle
-# Decode if there is something decode and return result or signal eof
-
- my $line = readline( $_[1] );
- (defined $line) ? MIME::QuotedPrint::decode_qp( $line ) : undef;
+ # decode and return
+ my $line= readline( $_[1] );
+ return ( defined $line )
+ ? MIME::QuotedPrint::decode_qp($line)
+ : undef;
} #FILL
-#-----------------------------------------------------------------------
+#-------------------------------------------------------------------------------
# IN: 1 instantiated object (ignored)
# 2 buffer to be written
# 3 handle to write to
@@ -44,11 +45,14 @@ sub FILL {
sub WRITE {
-# Encode whatever needs to be encoded and write to handle: indicate result
-
- (print {$_[2]} MIME::QuotedPrint::encode_qp($_[1])) ? length($_[1]) : -1;
+ # encode and write to handle: indicate result
+ return ( print { $_[2] } MIME::QuotedPrint::encode_qp( $_[1] ) )
+ ? length( $_[1] )
+ : -1;
} #WRITE
+#-------------------------------------------------------------------------------
+
__END__
=head1 NAME
@@ -59,11 +63,15 @@ PerlIO::via::QuotedPrint - PerlIO layer for quoted-printable strings
use PerlIO::via::QuotedPrint;
- open( my $in,'<:via(QuotedPrint)','file.qp' )
- or die "Can't open file.qp for reading: $!\n";
+ open( my $in, '<:via(QuotedPrint)', 'file.qp' )
+ or die "Can't open file.qp for reading: $!\n";
- open( my $out,'>:via(QuotedPrint)','file.qp' )
- or die "Can't open file.qp for writing: $!\n";
+ open( my $out, '>:via(QuotedPrint)', 'file.qp' )
+ or die "Can't open file.qp for writing: $!\n";
+
+=head1 VERSION
+
+This documentation describes version 0.07.
=head1 DESCRIPTION
@@ -87,8 +95,8 @@ Based on example that was initially added to MIME::QuotedPrint.pm for the
=head1 COPYRIGHT
-Copyright (c) 2002-2003 Elizabeth Mattijsen. All rights reserved. This
-library is free software; you can redistribute it and/or modify it under
+Copyright (c) 2002, 2003, 2004, 2012 Elizabeth Mattijsen. All rights reserved.
+This library is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
=cut
diff --git a/cpan/PerlIO-via-QuotedPrint/t/QuotedPrint.t b/cpan/PerlIO-via-QuotedPrint/t/QuotedPrint.t
index 69eb625f17..33366bd565 100644
--- a/cpan/PerlIO-via-QuotedPrint/t/QuotedPrint.t
+++ b/cpan/PerlIO-via-QuotedPrint/t/QuotedPrint.t
@@ -3,11 +3,6 @@ BEGIN { # Magic Perl CORE pragma
print "1..0 # Skip: PerlIO not used\n";
exit 0;
}
- require Config;
- if (($Config::Config{'extensions'} !~ m!\bPerlIO/via\b!) ){
- print "1..0 # Skip -- Perl configured without PerlIO::via module\n";
- exit 0;
- }
if (ord("A") == 193) {
print "1..0 # Skip: EBCDIC\n";
}
@@ -26,21 +21,11 @@ This is a tést for quoted-printable text that has hàrdly any speçial characters
in it.
EOD
-my $encoded;
-
-if (ord('A') == 193) { # EBCDIC.
- $encoded = <<EOD;
-This is a t=51st for quoted-printable text that has h=44rdly any spe=48ial =
-characters
-in it.
-EOD
-} else {
- $encoded = <<EOD;
+my $encoded = <<EOD;
This is a t=E9st for quoted-printable text that has h=E0rdly any spe=E7ial =
characters
in it.
EOD
-}
# Create the encoded test-file
@@ -73,3 +58,4 @@ ok( close( $in ), 'close decoding handle' );
# Remove whatever we created now
ok( unlink( $file ), "remove test file '$file'" );
+1 while unlink $file; # multiversioned filesystems