Skip to content
Browse files

Trim out unneeded code

  • Loading branch information...
1 parent 70f3de9 commit 5b0ab0cfad4c2fa5b3b427967d4ab8ce050519b6 @doherty committed Jun 11, 2011
Showing with 1 addition and 27 deletions.
  1. +1 −27 lib/utf8/all.pm
View
28 lib/utf8/all.pm
@@ -52,39 +52,13 @@ sub import {
# utf8 by default on filehandles
open::import($class, ':encoding(UTF-8)');
open::import($class, ':std');
- {
- no strict 'refs'; ## no critic (TestingAndDebugging::ProhibitNoStrict)
- *{$class . '::open'} = \&utf8_open;
- }
- #utf8 in @ARGV
+ # utf8 in @ARGV
state $have_encoded_argv = 0;
_encode_argv() unless $have_encoded_argv++;
return;
}
-sub unimport {
- $^H{'utf8::all'} = 0;
- return;
-}
-
-sub utf8_open(*;$@) { ## no critic (Subroutines::ProhibitSubroutinePrototypes)
- my $ret;
- if( @_ == 1 ) {
- $ret = CORE::open $_[0];
- }
- else {
- $ret = CORE::open $_[0], $_[1], @_[2..$#_];
- }
-
- # Don't try to binmode an unopened filehandle
- return $ret unless $ret;
-
- my $h = (caller 1)[10];
- binmode $_[0], ':encoding(UTF-8)' if $h->{'utf8::all'};
- return $ret;
-}
-
sub _encode_argv {
$_ = Encode::decode('UTF-8', $_) for @ARGV;
return;

0 comments on commit 5b0ab0c

Please sign in to comment.
Something went wrong with that request. Please try again.