Re: Splitting and comparing file names



In article <1166122284.911685.49900@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"Jake" <Jake.Newly@xxxxxxxxx> wrote:

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

For numerical comparison, use '>', not gt.

Boyd
.