Subject: | [PATCH] Use File::Slurper instead of File::Slurp::Tiny |
File::Slurp::Tiny is discouraged in favor of File::Slurper, which has a much simpler interface. As it is only used to read and write files with the raw layer, the change is simple.
Subject: | 0001-Use-File-Slurper-instead-of-File-Slurp-Tiny.patch |
From 8d84ddd36b61e27d36ed28b907e8b0401d003a95 Mon Sep 17 00:00:00 2001
From: Dan Book <grinnz@grinnz.com>
Date: Mon, 6 Nov 2017 19:37:17 -0500
Subject: [PATCH] Use File::Slurper instead of File::Slurp::Tiny
---
Makefile.PL | 2 +-
lib/XML/Compile/XOP/Include.pm | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile.PL b/Makefile.PL
index 3804a4a..8147811 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -13,7 +13,7 @@ my $prereq =
, LWP => 6.08
, Net::HTTP => 6.16 # older versions contain nasty bugs
, Time::HiRes => 0
- , File::Slurp::Tiny => 0
+ , File::Slurper => 0
, Test::More => 0.54
};
diff --git a/lib/XML/Compile/XOP/Include.pm b/lib/XML/Compile/XOP/Include.pm
index 05b06f0..0230a95 100644
--- a/lib/XML/Compile/XOP/Include.pm
+++ b/lib/XML/Compile/XOP/Include.pm
@@ -13,7 +13,7 @@ $VERSION = '3.22';
use Log::Report 'xml-compile-soap', syntax => 'SHORT';
use XML::Compile::SOAP::Util qw/:xop10/;
use HTTP::Message ();
-use File::Slurp::Tiny qw/read_file write_file/;
+use File::Slurper qw/read_binary write_binary/;
use Encode qw/decode FB_CROAK/;
@@ -55,7 +55,7 @@ sub content(;$)
{ my ($self, $byref) = @_;
unless($self->{bytes})
{ my $f = $self->{file};
- my $bytes = try { read_file $f, binmode => ':raw' };
+ my $bytes = try { read_binary $f };
fault "failed reading XOP file {fn}", fn => $f if $@;
$self->{bytes} = \$bytes;
}
@@ -104,7 +104,7 @@ sub mimePart(;$)
sub write($)
{ my ($self, $file) = @_;
- write_file $file, {binmode => ':raw'}, $self->content(1);
+ write_binary $file, $self->content(1);
}
1;
--
2.9.5