Instead of setting $Chr{$key} = undef, set it to 1. Then, instead of looping through each key in the hash to find a match, you can just do a if ($Chr{$line[0]}). I only glanced over your code, so I may have missed something that would stop this from working, but there is a definite red flag when you are looping over the keys in a hash and comparing each one to some value.
--MidLifeXis
In reply to Re: help speeding up my perl code
by MidLifeXis
in thread help speeding up my perl code
by a217
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |