#!/usr/bin/perl use strict; use warnings; use constant KEYS => 10_000_000; my %hash; keys %hash=KEYS; @hash{1..KEYS}=(1) x KEYS; __END__