for my $name(keys %hash) { print $filehandle "$name\n"; }