%goodhash = ( red => '1', blue => '2', green => '3', ); @colors = qw(red blue green); print $fh join("|", @hash{@colors}), "\n"