From 6f80b1a76fe743a6c0ac7647f0e2663c4d3db126 Mon Sep 17 00:00:00 2001 From: Bas Zoetekouw Date: Tue, 30 Sep 2008 18:54:06 +0000 Subject: Remove use of File::Slurp CVS version numbers check_trans.pl: 1.68 -> 1.69 --- check_trans.pl | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'check_trans.pl') diff --git a/check_trans.pl b/check_trans.pl index c89253a534d..7c0821ceac6 100755 --- a/check_trans.pl +++ b/check_trans.pl @@ -83,7 +83,6 @@ use File::Basename; use File::Spec::Functions; use List::MoreUtils qw{ uniq }; use Term::ANSIColor; -use File::Slurp; use Encode; #use Data::Dumper; use FindBin; @@ -681,6 +680,24 @@ sub get_diff return $difftxt; } +#================================================= +##== read en entire file and return the text +##== +sub read_file +{ + my $filename = shift or die("Internal error: no file specified"); + + # slurp mode + local $/ = undef; + + # read the file + open( my $fd, '<', $filename ) + or die("Couldn't open file `$filename': $!\n"); + my $text = <$fd>; + close( $fd ); + + return $text; +} #================================================= #== get a diff while trying to match html tags -- cgit v1.2.3