my $seq = 'KLLS3'; my $point = 'weight'; my $index = 4; my $mean = 1.443; my %hash; sorting($seq, $index, $point, $mean); sub sorting { if ($_[0] eq "KLLS3_LT.V4_0") { if ($_[1] == "1") {push @{$hash{$_[2]}{$_[0]}{$_[1]}}, $_[3];} } }