while (my $currentlist_row = $currentlist_csv->getline_hr($currentlist_fh)) { my $lscore_fh; if (exists($lscore{$currentlist_row->{FacID}})) { $lscore_fh = $fh{$currentlist_row->{FacID}} //= do { open my $f, '>:utf8', $lscore{$currentlist_row->{FacID}}; $f; }; } else { $lscore_fh = $fh{__LSCORE__} //= do { open my $f, '>:utf8', $lscore_fallback_file; $f; }; }