Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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!

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2017-07-22 04:01 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (336 votes). Check out past polls.