in reply to Pass anonymous hash - keys only?

Be aware that your get_ids is using map in void context.

As for the anonymous hash, you can use map in its rightful list context to create a hash without manually inserting the values.
#!/usr/bin/perl -w use strict; sub get_ids { my $hashref = shift; print map {"$_\n"} keys %$hashref; # or, depending on your tastes # print "$_\n" for keys %$hashref; } get_ids( {map {$_,1} qw(one two three)} );
update Added link to Perl FAQ 6.
_ _ _ _ (_|| | |(_|>< _|