use Acme::FishFarm's check_water_filter sub check_water_filter { my ( $water_filter, $current_reading ) = @_; my $waste_threshold = $water_filter->waste_count_threshold;
$water_filter->current_waste_count( $current_reading );
print "Current Waste Count: ", $current_reading, " (high: >= ", $waste_threshold, ")\n";
if ( $water_filter->is_cylinder_dirty ) {
print " !! Filtering cylinder is dirty!\n";
print " Cleaned the filter!\n";
$water_filter->clean_cylinder;
} else {
print " Filtering cylinder is still clean.\n";
}
1;
}