in reply to Effecicncy of key-only hash

As others have suggested, I'd do it like this
my %hash = map { $_ => 1 } qw{ shave the modern way };

because, wherever possible, I want to keep declaration with initialisation.

It's probably a personal thing, but it really bugs me when I've got to separate them, as in

my $str; $str = $_ x $freq{$_} for sort keys %freq;

which I had to write earlier today.

If you're really that concerned about speed, do it in C instead.
If you're really that concerned about memory, get more. It's really cheap nowadays.


Unless I state otherwise, all my code runs with strict and warnings