Currently when I want to build a look-up table I use:
my $has_field = {};
map { $has_field->{$_} = 1 } @fields;
Is there a way I can do inline initialization in a single step? (i.e. populate it at the same time I'm declaring it?)
Currently when I want to build a look-up table I use:
my $has_field = {};
map { $has_field->{$_} = 1 } @fields;
Is there a way I can do inline initialization in a single step? (i.e. populate it at the same time I'm declaring it?)