Web lists-archives.com

Re: handling lists in perl




On 2018-12-19 08:34, deloptes wrote:
mick crane wrote:

yes but there is only one 100, only one key can have it.
I still try to figure out what goes on with the hash pairs
with a longer list of numbers your example seems to pick up on the
values somehow.
I dunno, unless there is something about using $_ in a loop being
unreliable ?
I persevere to succeed

(1=>8,2=>20,6=>100,15=>100....)

this is what you originally posted, so both 6 and 15 match 100 from the list

when key is 6 it compares 100 with each element from the list and matches
100. Same goes for 15.
No idea what you mean!

regards


given a set of *unique* numbers ( there is just one of the numbers in the list) and a list of possible pairings find which pairs you can make from the list. 6 can pair with 100 and 15 can pair with 100 but they cannot both be in the list of possible pairings because there is only one 100.




--
Key ID    4BFEBB31