Re: Splitting and comparing file names
- From: "Jake" <Jake.Newly@xxxxxxxxx>
- Date: 14 Dec 2006 10:51:24 -0800
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
.
- Follow-Ups:
- Re: Splitting and comparing file names
- From: boyd
- Re: Splitting and comparing file names
- References:
- Splitting and comparing file names
- From: Jake
- Re: Splitting and comparing file names
- From: boyd
- Re: Splitting and comparing file names
- From: Jake
- Splitting and comparing file names
- Prev by Date: Re: Splitting and comparing file names
- Next by Date: Re: Splitting and comparing file names
- Previous by thread: Re: Splitting and comparing file names
- Next by thread: Re: Splitting and comparing file names
- Index(es):