my %hash; my @arr= qw( This is a test ); $hash{@arr}= 1; $hash{@arr[0,1,2,3]}= 2; $hash{@arr[0,1],@arr[2,3]}= 3; print join $/, sort(keys %hash), "";