if (/^c_/) { $check{$_} = "CHECKED" print OUT "$in{$_}\t"; } else { print OUT "no data\t"; # or just "\t" }