Re: creating a hash



Hi,

I use to put this hash in a file and get the content using

my $hashref = do $file;

And I want to be able to get the dupplicate keys in order to delete them
manually, without needing to search for each manually and compare it with
every other key from the hash, because if there are only a few keys there is
no problem, but if there are very many... it is.

Thank you.


----- Original Message -----
From: "Xavier Noria" <fxn@xxxxxxxxxxx>
To: "Perl Beginners" <beginners@xxxxxxxx>
Sent: Friday, July 15, 2005 3:33 PM
Subject: Re: creating a hash


> On Jul 15, 2005, at 13:38, Octavian Rasnita wrote:
>
> > I know that if there are more keys with the same name, the last is
> > used, but
> > I would like to clean the hash.
>
> Given
>
> $h = { foo => 0, bar => 1, foo => 2 };
>
> what do you mean by "cleaning" $h ?
>
> -- fxn
>
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx
> For additional commands, e-mail: beginners-help@xxxxxxxx
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>

.



Relevant Pages

  • Re: Suggestion for an AES Based Hash Function
    ... amateurs posting here seem to favour cyphers, I go for hash functions. ... Rather than trying to use a strong one-way compression function would ... I have used a fixed set of keys in two places. ... preferred to have the first round keys fixed and to start deriving ...
    (sci.crypt)
  • Suggestion for an AES Based Hash Function
    ... amateurs posting here seem to favour cyphers, I go for hash functions. ... Rather than trying to use a strong one-way compression function would ... The round function ... I have used a fixed set of keys in two places. ...
    (sci.crypt)
  • Re: sort unique
    ... given that a hash table is not ... IMO if the vendor's algorithm does something "obvious", ... function to eliminate keys that hash to the same bucket per some ... strings of random lengths, and two strings are ...
    (comp.lang.lisp)
  • Re: My First C# (warning - long post)
    ... defined as a COBOL structure of 8192 bytes (this is for ... Hashtables use two objects, one is a 'key' and the other a 'value'. ... but is for storing keys only. ... // Add some elements to the hash table. ...
    (comp.lang.cobol)
  • Re: Why are tuples immutable?
    ... >>And how exactly do you propose to mutate an object without changing its ... >>If the hash values are the same, you lose because you didn't keep your ... keys being mutable objects, that they want to mutate those object while ... > objects used as keys in order to access it. ...
    (comp.lang.python)