[libcode-tidyall-perl] 257/374: elim File::Slurp
Jonas Smedegaard
js at alioth.debian.org
Sun Sep 29 22:26:31 UTC 2013
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository libcode-tidyall-perl.
commit b1782fcc42bfed003caf41150810bb4b5cb1c4e3
Author: Jonathan Swartz <swartz at pobox.com>
Date: Mon Sep 24 21:29:37 2012 -0700
elim File::Slurp
---
lib/Code/TidyAll/Util.pm | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/lib/Code/TidyAll/Util.pm b/lib/Code/TidyAll/Util.pm
index 5c98a37..8dceb1d 100644
--- a/lib/Code/TidyAll/Util.pm
+++ b/lib/Code/TidyAll/Util.pm
@@ -3,7 +3,6 @@ use Cwd qw(realpath);
use Data::Dumper;
use File::Basename;
use File::Path;
-use File::Slurp qw(read_file write_file);
use File::Spec::Functions qw(abs2rel rel2abs);
use File::Temp qw(tempdir);
use Guard;
@@ -65,4 +64,17 @@ sub trim {
return $str;
}
+sub read_file {
+ my ($file) = @_;
+ open( my $fh, "<", $file ) or die "could not open $file: $!";
+ my $contents = do { local $/; <$fh> };
+ return $contents;
+}
+
+sub write_file {
+ my ( $file, $contents ) = @_;
+ open( my $fh, ">", $file ) or die "could not open $file: $!";
+ print $fh $contents;
+}
+
1;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcode-tidyall-perl.git
More information about the Pkg-perl-cvs-commits
mailing list