1)
my %hash = map {$_ => 1} @array;
2) you got to use
delete $myhash{$key} to erase it from
%myhash and then you're gonna have no problem as the
for loop iterates over the elements of the anonymous array created by
keys(%myhash)
Update:
broquaint can type faster than me ;)
$|=$_="1g2i1u1l2i4e2n0k",map{print"\7",chop;select$,,$,,$,,$_/7}m{..}g