--- lib/PXElator/server.pm 2009/07/31 13:16:11 74 +++ lib/PXElator/server.pm 2009/08/03 08:52:32 118 @@ -3,6 +3,8 @@ use warnings; use strict; +use Module::Refresh; + our $ip = '172.16.10.1'; our $netmask = '255.255.255.0'; @@ -12,7 +14,20 @@ use config; -our $debug = 0; -sub debug { $debug = config::shared('debug', @_) } +our $debug; +sub debug { $debug = config::shared('debug', @_) || 0 } + +my $timestamp_interval = 3; +my $stderr_tell = 0; + +$SIG{ALRM} = sub { + if ( tell(STDERR) != $stderr_tell ) { + warn "\nTIMESTAMP: " . localtime() . "\n\n"; + $stderr_tell = tell(STDERR); + Module::Refresh->refresh; + } + alarm $timestamp_interval; +}; +alarm $timestamp_interval; warn "loaded";