foreach my $employee (@employees) { if ( defined $employee->salary and $employee->salary < $threshold ) { increase_salary( $employee, 3_000 ); } }