in reply to Re: insert label into file
in thread insert label into file
I have repeat values, I read this but now I don't know how to proceed..
If your hash could have repeated values, the methods above will only find one of the associated keys. This may or may not worry you. If it does worry you, you can always reverse the hash into a hash of arrays instead:
I am confused enough just using hash, hash of arrays, can I put it back into a hash somehow?, reason I want the hash is to input the data into a table in sql, using sql abstract, which looks like it should work for my purpose to store this data in a db, maybe I could somehow fix my data file to be correct by changing the way information is logged so that its numbers then names by using regexes to move the labels I have around.while (($key, $value) = each %by_key) { push @{$key_list_by_value{$value}}, $key; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: insert label into file
by kennethk (Abbot) on Mar 20, 2009 at 16:49 UTC | |
by grashoper (Monk) on Mar 20, 2009 at 17:45 UTC | |
by kennethk (Abbot) on Mar 20, 2009 at 18:23 UTC | |
by grashoper (Monk) on Mar 20, 2009 at 19:07 UTC | |
by kennethk (Abbot) on Mar 20, 2009 at 19:12 UTC |
In Section
Seekers of Perl Wisdom