However, this also work: $user_weight{$cols[0]} ||= 1;
That will fail in the case in which the 'special' assigned weight for a worker is zero (maybe he or she is on vacation that week?): such a worker will be assigned a work-weight of 1.
Update: Perl versions lacking // might use exists:
$user_weight{$cols[0]} = 1 unless exists $user_weight{$cols[0]};
In reply to Re^4: Weighted Calculation
by AnomalousMonk
in thread Weighted Calculation
by dirtdog
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |