The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

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;
}