You might want to split out the "cleanup" aspects into a different
patch. You changed some alignments.
> +my $curload = 0.0;
> +sub getLoadAvg {
> + if ( $^O =~ /^linux$/i ) {
> + if ( open PROC_LOADAVG, '/proc/loadavg') {
> + ($curload = <PROC_LOADAVG>) =~
> s/^\s*(\d+\.\d+)\s.*$/$1/;
> + close PROC_LOADAVG;
> + }
> + $curload =~ s/\n//;
> +}
This is the first "platform specific" stuff we have. I'd rather not
see that go into the main binary. I'm sure there is a module that
someone has written that abstracts this all away.
Matt's suggestion to make it a connect hook makes more sense though.
It keeps everything nice and independent.
-R