my @common_keys = qw/custClli switchClli trkCount tgid btfn flag location ldn .../; my ( %tmp, %mylist ); # use @common_keys with each hash