First, Isolate The Untestable Part

sub should_i_sleep {
    my($power_remaining) = @_;
    snooze if $power_remaining < $Min_Power;
    return 1;
}
sub snooze {
    system("/sbin/snooze");
}

Test snooze() by hand once.

| toc |