in reply to Array length within a hash

Replace this line:
$length = $Hash{$key};
with this line:
$length = @{$Hash{$key}};
Remember that you're storing references to the arrays as the values of your hash. You need to dereference those values...

-Ton
-----
Be bloody, bold, and resolute; laugh to scorn
The power of man...