in reply to scanning hash
$count = 1#!/bin/perl5 use strict; use warnings; my %hash = ( key1 => 0, key2 => 0, key3 => 0); my %dups = reverse %hash; my $count = keys %dups; print "$count\n";
Beaten to the post of course. This is just in case you wanted to do it on two lines instead of one!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: scanning hash
by Aristotle (Chancellor) on Aug 01, 2004 at 14:41 UTC |