my %hash = map { @_ = split /,/, $_; $_[0] => $_[1] } @array; my $first_key = (sort keys %hash)[0];