summaryrefslogtreecommitdiff
path: root/ext/Encode/encoding.pm
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-04-19 12:58:00 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-04-19 12:58:00 +0000
commit85982a32ef23cb53c2fae6d3861dd7dc62e3ab17 (patch)
tree7b5761fb803a2d391809ecbe9d2cd7b7895b0ae4 /ext/Encode/encoding.pm
parente662ec5f13086f182e381a14fb43524ffc1b7e27 (diff)
downloadperl-85982a32ef23cb53c2fae6d3861dd7dc62e3ab17.tar.gz
Upgrade to Encode 1.50, from Dan Kogai.
p4raw-id: //depot/perl@16001
Diffstat (limited to 'ext/Encode/encoding.pm')
-rw-r--r--ext/Encode/encoding.pm16
1 files changed, 5 insertions, 11 deletions
diff --git a/ext/Encode/encoding.pm b/ext/Encode/encoding.pm
index 618535fecf..f1873247e1 100644
--- a/ext/Encode/encoding.pm
+++ b/ext/Encode/encoding.pm
@@ -1,5 +1,5 @@
package encoding;
-our $VERSION = do { my @r = (q$Revision: 1.28 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
+our $VERSION = do { my @r = (q$Revision: 1.30 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
use Encode;
use strict;
@@ -11,15 +11,8 @@ BEGIN {
}
}
-our $HAS_PERLIO_ENCODING;
-
-eval { require PerlIO::encoding; };
-if ($@){
- $HAS_PERLIO_ENCODING = 0;
-}else{
- $HAS_PERLIO_ENCODING = 1;
- binmode(STDIN);
-}
+our $HAS_PERLIO = exists $INC{"PerlIO/encoding.pm"};
+$HAS_PERLIO or binmode(STDIN);
sub import {
my $class = shift;
@@ -34,7 +27,7 @@ sub import {
}
unless ($arg{Filter}){
${^ENCODING} = $enc; # this is all you need, actually.
- $HAS_PERLIO_ENCODING or return 1;
+ $HAS_PERLIO or return 1;
for my $h (qw(STDIN STDOUT)){
if ($arg{$h}){
unless (defined find_encoding($arg{$h})) {
@@ -85,6 +78,7 @@ sub unimport{
1;
__END__
+
=pod
=head1 NAME