Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Trying to remove duplicate rows using hashes

by mje (Curate)
on Oct 21, 2008 at 15:57 UTC ( #718523=note: print w/replies, xml ) Need Help??


in reply to Trying to remove duplicate rows using hashes

I think you'll find you've at least got an error here:

if(!$hash{$c_id}{$f_var}) { $hash{$c_id}{$f_var} = $d_id; }

as I think a) that will always test true (I think you want to look at perldoc -f exists) and b) you are only going to get the first c_id/f_id and you didn't say that is what you wanted - you said remove duplicates.

Replies are listed 'Best First'.
Re^2: Trying to remove duplicate rows using hashes
by driver8 (Scribe) on Oct 21, 2008 at 19:59 UTC

    I think that you are wrong about both of those. Did you test it?

Re^2: Trying to remove duplicate rows using hashes
by Angharad (Pilgrim) on Oct 21, 2008 at 16:18 UTC
    Yes, its duplicates I would like removed.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2023-04-02 05:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?