Re: Splitting and comparing file names



So the next question would be, what comparison logic would be the most
efficient. I was thinking of something similar to this:

my $loadavg = 0;
foreach my $filename(@filesfound) {
$filename =~ s/.load$//;
my ($hostname, @loadvals) = split (/#/, $filename);
if $loadavg gt sum(@loadvals)/(scalar @times) {
my $bldhost = $hostname;
};
};

I basically just need an output of a hostname to provide to another
script based on the average load from the uptime values listed in the
filename.

Thanks again everyone!

Regards,

Jake

.