Permalink
Browse files

remove File::Slurp

  • Loading branch information...
1 parent 89a461e commit 37cb27db812f9869a08cf8f7e4c956dde433a02d @xaicron committed Oct 12, 2011
Showing with 7 additions and 3 deletions.
  1. +0 −1 Makefile.PL
  2. +7 −2 lib/App/pmuninstall.pm
View
@@ -12,7 +12,6 @@ WriteMakefile(
'Module::CoreList' => 0,
'version' => 0,
'JSON::PP' => 0,
- 'File::Slurp' => 0,
},
LICENSE => 'perl',
EXE_FILES => [ 'bin/pm-uninstall' ],
@@ -12,7 +12,6 @@ use HTTP::Tiny;
use Term::ANSIColor qw(colored);
use Cwd ();
use JSON::PP qw(decode_json);
-use File::Slurp qw(slurp);
our $VERSION = "0.24";
@@ -191,7 +190,7 @@ sub find_meta {
next unless $lib =~ /$Config{archname}/;
my $install_json = "$lib/.meta/$distvname/install.json";
next unless -f $install_json && -r _;
- my $data = decode_json slurp $install_json;
+ my $data = decode_json +$self->slurp($install_json);
$name = $data->{name};
$self->puts("-> Found .meta/$distvname/install.josn");
last;
@@ -355,6 +354,12 @@ sub fetch {
return $res->{content};
}
+sub slurp {
+ my ($self, $file) = @_;
+ open my $fh, '<', $file or die "$file $!";
+ do { local $/; <$fh> };
+}
+
sub puts {
my ($self, @msg) = @_;
push @msg, '' unless @msg;

0 comments on commit 37cb27d

Please sign in to comment.