aboutsummaryrefslogtreecommitdiffstats
path: root/check_trans.pl
diff options
context:
space:
mode:
authorBas Zoetekouw <bas>2008-09-30 18:54:06 +0000
committerBas Zoetekouw <bas>2008-09-30 18:54:06 +0000
commit6f80b1a76fe743a6c0ac7647f0e2663c4d3db126 (patch)
tree88a8a687218b3ffd3f4ebc7a94130ef27849d555 /check_trans.pl
parente735a93611e504055179f697746841335f0ffdb6 (diff)
Remove use of File::Slurp
CVS version numbers check_trans.pl: 1.68 -> 1.69
Diffstat (limited to 'check_trans.pl')
-rwxr-xr-xcheck_trans.pl19
1 files changed, 18 insertions, 1 deletions
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

© 2014-2024 Faster IT GmbH | imprint | privacy policy