http://qs321.pair.com?node_id=123629


in reply to Re: Finding missing elements in a sequence (code)
in thread Finding missing elements in a sequence (code)

Ah, I see.

Well, you need to make things equal before comparing them ... you are putting numbers 1..n as keys into %isthere, but try to get out $isthere{"00001"}. That will not work - the keys in %isthere are "1" etc.

This is what you need to make it work:

$isthere{$_} = "yes" for map {$_+0} @list;

Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com