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