Help for this page
my %gp = ( ... Gi => \@gi, # an array ref Gt => \@gt, );
... $j = $gp{$i}; ... } for $val (@values){ ...