in reply to Pattern Matching Question

Use Tie::File to access lines in your file as elements in an array.

Iterate over the array, and attempt to extract user information from each element. If successful, add the user to the hash.

use Tie::File; tie my @file_array, 'Tie::File', $filename foreach (@file_array) { if (/^([^:]+)(?::[^:]*){6}:([^:+]+):/) { # this regexp can pro +bably be improved. $users{$1} = $2; # you can add a debug print here if you want. } } untie @file_array;
(Not tested.)