#!/usr/bin/perl -w use strict; my $key='a'; my %check=($key=>1); # Used to find keys that hash similarly my %fill= %check; # Used to show hash isn't expanded my %grow= %check; # Used to show when hash does expand $|++; while( 1 ) { $grow{$a}= $check{++$a}= 1; if( 1 == substr(%check,0,1) ) { $fill{$a}= 1; print %grow." ".%check." ".%fill." ".keys(%fill).$/; } else { delete $grow{$a}; } delete $check{$a}; }