blob: bd374da3df618909cbc999635cd0c30f4bc886f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
package Echolot::Globals;
# (c) 2002 Peter Palfrader <peter@palfrader.org>
# $Id: Globals.pm,v 1.2 2002/06/20 04:27:37 weasel Exp $
#
=pod
=head1 Name
Echolot::Globals - echolot global variables
=head1 DESCRIPTION
=cut
use strict;
use warnings;
use Carp;
my $GLOBALS;
sub init {
my $hostname = `hostname`;
$hostname =~ /^([a-zA-Z0-9_-]*)$/;
$hostname = $1 || 'unknown';
$GLOBALS->{'hostname'} = $hostname;
$GLOBALS->{'internalcounter'} = 1;
};
sub initStorage {
$GLOBALS->{'storage'} = new Echolot::Storage::File ( datadir => Echolot::Config::get()->{'storage'}->{'File'}->{'basedir'} );
};
sub get() {
return $GLOBALS;
};
1;
# vim: set ts=4 shiftwidth=4:
|