Re: Splitting and comparing file names
- From: boyd <tbmoore9@xxxxxxxxxxx>
- Date: Thu, 14 Dec 2006 18:54:46 GMT
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
.
- References:
- Splitting and comparing file names
- From: Jake
- Re: Splitting and comparing file names
- From: boyd
- Re: Splitting and comparing file names
- From: Jake
- 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: [OT?] Re: Which module for web graph?
- Previous by thread: Re: Splitting and comparing file names
- Next by thread: Re: Splitting and comparing file names
- Index(es):