in reply to Sleep has high cpu
Your problem is that you are never reaching your sleep statement. Your loops is
while (1) { ....#check drive freespace my $low = @lowDrives > 0 ? join(' and ',lowDrives) : No'; next if ($low eq 'No'); ## <<< PROBLEM HERE! .... sleep 2 *3600; .... }
Which means that if none of your drives are low, you do next, which goes back and checks again. You never reach the sleep.
sleep works fine, you're just never actually calling it.
|
|---|