summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Echolot/Stats.pm22
-rw-r--r--Echolot/Tools.pm17
2 files changed, 20 insertions, 19 deletions
diff --git a/Echolot/Stats.pm b/Echolot/Stats.pm
index 48e9ae8..905f210 100644
--- a/Echolot/Stats.pm
+++ b/Echolot/Stats.pm
@@ -1,7 +1,7 @@
package Echolot::Stats;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: Stats.pm,v 1.55 2003/02/28 18:12:21 weasel Exp $
+# $Id: Stats.pm,v 1.56 2003/06/06 09:32:37 weasel Exp $
#
=pod
@@ -255,20 +255,6 @@ sub calculate($$) {
};
};
-sub read_file($;$) {
- my ($name, $fail_ok) = @_;
-
- unless (open (F, $name)) {
- Echolot::Log::warn("Could not open '$name': $!.") unless ($fail_ok);
- return undef;
- };
- local $/ = undef;
- my $result = <F>;
- close (F);
-
- return $result;
-};
-
sub write_file($$$$) {
my ($filebasename, $html_template, $expires, $output) = @_;
@@ -624,9 +610,9 @@ sub build_lists() {
my %stats;
my %addresses;
- my $hardbroken1 = read_file( Echolot::Config::get()->{'broken1'}, 1);
- my $hardbroken2 = read_file( Echolot::Config::get()->{'broken2'}, 1);
- my $sameop = read_file( Echolot::Config::get()->{'sameop'}, 1);
+ my $hardbroken1 = Echolot::Tools::read_file( Echolot::Config::get()->{'broken1'}, 1);
+ my $hardbroken2 = Echolot::Tools::read_file( Echolot::Config::get()->{'broken2'}, 1);
+ my $sameop = Echolot::Tools::read_file( Echolot::Config::get()->{'sameop'}, 1);
my $pubbroken1;
my $pubbroken2;
my $privbroken1;
diff --git a/Echolot/Tools.pm b/Echolot/Tools.pm
index 4426b86..fd86a4c 100644
--- a/Echolot/Tools.pm
+++ b/Echolot/Tools.pm
@@ -1,7 +1,7 @@
package Echolot::Tools;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: Tools.pm,v 1.21 2003/02/28 17:10:57 weasel Exp $
+# $Id: Tools.pm,v 1.22 2003/06/06 09:32:37 weasel Exp $
#
=pod
@@ -349,6 +349,21 @@ sub make_garbage() {
return $random;
};
+sub read_file($;$) {
+ my ($name, $fail_ok) = @_;
+
+ unless (open (F, $name)) {
+ Echolot::Log::warn("Could not open '$name': $!.") unless ($fail_ok);
+ return undef;
+ };
+ local $/ = undef;
+ my $result = <F>;
+ close (F);
+
+ return $result;
+};
+
+
1;
# vim: set ts=4 shiftwidth=4: