in reply to Hash table of arrays

I'd take a slightly different approach. If you stored your data as a hash of hashes, then the keys in the first hash could be the machine name and the values could be references to second level hashes. The key to these hashes would be the user names and the values would be an integer which is incremened each time to find a particular user on a particular machine.

You could replace your code above with:

$machinearray{$machine}{$user}++;

which would automatically creat sub-hashes as required.

As a bonus, you could easily find if a particular user is on a particular machine using

if (exists $machinearray{$machine}{$user})

and you could get a list of users on a particular machine using

keys %{$machinearray{$machine}};
--
<http://www.dave.org.uk>

European Perl Conference - Sept 22/24 2000, ICA, London
<http://www.yapc.org/Europe/>