From ecd052098413f87701ba00e28f88563248a177f6 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 5 Jun 2002 04:05:40 +0000 Subject: Initial Import --- Echolot/Globals.pm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Echolot/Globals.pm (limited to 'Echolot/Globals.pm') diff --git a/Echolot/Globals.pm b/Echolot/Globals.pm new file mode 100644 index 0000000..4b5eb13 --- /dev/null +++ b/Echolot/Globals.pm @@ -0,0 +1,37 @@ +package Echolot::Globals; + +# (c) 2002 Peter Palfrader +# $Id: Globals.pm,v 1.1 2002/06/05 04:05:40 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->{'storage'} = new Echolot::Storage::File ( datadir => Echolot::Config::get()->{'storage'}->{'File'}->{'basedir'} ); + $GLOBALS->{'internalcounter'} = 1; +}; + +sub get() { + return $GLOBALS; +}; + +1; +# vim: set ts=4 shiftwidth=4: -- cgit v1.2.3