in reply to Effecicncy of key-only hash
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.
|
|---|