next unless $line =~ m{^(\S+) (\d+) (.*)}; my ($site, $userID, $data, $data2) = ($1, $2, $3, $4); # you have 3 capturing paran's but you try to call $4 # your 2 data columns get folded together in $3 because of your greedy .* $user{$userID}{$site} = $data, $data2; # $data2 is useless and I think you are trying to use an array ref # but that is not what you are doing [ ] signifies an array ref