#!/usr/bin/env perl use strict; use warnings; use Test::More tests => 2; my %hash = ( alpha => 'one', gamma => 'three', beta => 'two' ); my @wantkeys = qw/alpha beta gamma/; my @wantvals = qw/one two three/; my @labels = sort keys %hash; is_deeply \@labels, \@wantkeys, "You said this doesn't work, but it does"; my @vals = @hash{@labels}; is_deeply \@vals, \@wantvals, "The values match up with the keys";