diff options
author | Bas Zoetekouw <bas> | 2008-09-30 18:54:06 +0000 |
---|---|---|
committer | Bas Zoetekouw <bas> | 2008-09-30 18:54:06 +0000 |
commit | 6f80b1a76fe743a6c0ac7647f0e2663c4d3db126 (patch) | |
tree | 88a8a687218b3ffd3f4ebc7a94130ef27849d555 /check_trans.pl | |
parent | e735a93611e504055179f697746841335f0ffdb6 (diff) |
Remove use of File::Slurp
CVS version numbers
check_trans.pl: 1.68 -> 1.69
Diffstat (limited to 'check_trans.pl')
-rwxr-xr-x | check_trans.pl | 19 |
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 |