Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Merge pull request #223 from schwern/utf8_vs_autodie"

This reverts commit 8912fc6, reversing
changes made to 829827e.

The fix is fine, but autodie fixed the problem and this would get in the way.
  • Loading branch information...
commit eb4501e84e24050b3183ead838c84fefb1e196f4 1 parent 8912fc6
@schwern schwern authored
Showing with 3 additions and 41 deletions.
  1. +1 −1  Build.PL
  2. +0 −3  Changes
  3. +1 −22 lib/perl5i/2.pm
  4. +1 −15 t/autodie.t
View
2  Build.PL
@@ -49,7 +49,7 @@ my $builder = MyBuild->new(
"Devel::Declare::MethodInstaller::Simple" => '0.006007',
'true::VERSION' => '0.16',
'Capture::Tiny' => '0.06',
- 'utf8::all' => '0.004',
+ 'utf8::all' => '0.002',
'Carp::Fix::1_25' => '1.000000',
},
build_requires => {
View
3  Changes
@@ -1,7 +1,4 @@
2.10.0
- Bug Fixes
- * Restore utf8 for newly opened filehandles.
-
Test Fixes
* Removed a use of Test::Exception, which we don't depend on.
View
23 lib/perl5i/2.pm
@@ -69,7 +69,7 @@ sub import {
indirect::unimport($class, ":fatal");
utf8::all::import($class);
- (\&open)->alias($caller, "open");
+ (\&perl5i::latest::open)->alias($caller, 'open');
# Export our gmtime() and localtime()
(\&{$Latest .'::DateTime::dt_gmtime'})->alias($caller, 'gmtime');
@@ -116,27 +116,6 @@ sub perl5i_die {
}
-# This function must be called open() because autodie will decide what to do
-# with the exception based on the name of the function.
-sub open(*;$@) { ## no critic (Subroutines::ProhibitSubroutinePrototypes)
- my $ret;
- if ( @_ == 1 ) {
- $ret = open $_[0];
- } elsif ( @_ == 2 ) {
- $ret = open $_[0], $_[1];
- } else {
- $ret = open $_[0], $_[1], @_[2..$#_];
- }
-
- # Don't try to binmode an unopened filehandle
- return $ret unless $ret;
-
- my $h = (caller 1)[10];
- binmode $_[0], ":encoding(utf8)" if $h->{perl5i};
- return $ret;
-}
-
-
sub load_in_caller {
my $caller = shift;
my @modules = @_;
View
16 t/autodie.t
@@ -1,7 +1,7 @@
#!perl
use perl5i::latest;
-use Test::More;
+use Test::More "no_plan";
ok !eval { open my $fh, "hlaglaghlaghlagh"; 1 };
@@ -12,17 +12,3 @@ if( $^O eq 'MSWin32' ) {
} else {
ok !eval { system "haljlkjadlkjflajdf"; 1; };
}
-
-note "open() message formatting"; {
- ok !eval { open my $fh, "i_do_not_exist"; 1 };
- is $@->file, __FILE__;
- is $@->line, __LINE__ - 2;
- unlike $@, qr/perl5i/, "open error should not mention perl5i";
-
- TODO: {
- local $TODO = 'open function from autodie exception';
- is $@->function, "open";
- }
-}
-
-done_testing;
Please sign in to comment.
Something went wrong with that request. Please try again.