in reply to Refactor huge subroutine
could become a function.Date_Cmp( _dateformat($_->get('hb_Local_date_lodged')), _dateformat($self->{date_str}) )
As a matter of personal taste, I'd turn
into a function. When I encounter a "next if", I don't want to dwell on the logic of the test, but to simply note that a test exists.exists $check{$_->qcs_job_name} {$lodgement->{reference}} {$_->qcs_sequence_no}) && ($check{$_->qcs_job_name} {$lodgement->{reference}} {$_->qcs_sequence_no}) && ($client_job_spoil ->hb_Local_spoils == 0);
Finally (and again, this is all just personal taste), consider changing
to$total_lodged = $_->qcs_document_count() - $client_job_spoil ->hb_Local_spoils;
It takes fewer lines and (if you align equal signs and operations) should be just as readable, if not more.$total_lodged = $_->qcs_document_count() - $client_job_spoil->hb_Loc +al_spoils;
|
---|