my @hashes = ( $hash_w, $hash_x, $hash_y, $hash_z ); my $max = max( values %{shift @hashes } ); $max = reduce { max( $_[0], values %{$_[1]} ) } @hashes;