@keys = keys{%hash}; foreach $key (@keys) { $value = $hash{$key}; # notice $ versus % here push(@values, $value); } sort(@values); print "@values\n"; #### Can't use subscript on private hash at foo.pl line 123, near "$key}" (Did you mean $ or @ instead of %?) BEGIN not safe after errors--compilation aborted at foo.pl line 123.