Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: scanning hash

by wfsp (Abbot)
on Aug 01, 2004 at 09:28 UTC ( #379041=note: print w/ replies, xml ) Need Help??

in reply to scanning hash

#!/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";
$count = 1

Beaten to the post of course. This is just in case you wanted to do it on two lines instead of one!

Comment on Re: scanning hash
Download Code
Replies are listed 'Best First'.
Re^2: scanning hash
by Aristotle (Chancellor) on Aug 01, 2004 at 14:41 UTC
    Again, incorrect, like Re: scanning hash. This approach treats undefs and empty strings as the same.

    Makeshifts last the longest.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://379041]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2015-11-26 01:15 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (695 votes), past polls