my %entry; #global to store entries sub get_entry{ my $num = shift; if ( !Exists( $entry{$num}{'entry'} ) { $entry{$num}{'entry'} = $frame->Entry()->pack(); } else { #repack $entry{$num}{'entry'}->pack(); } }