#!/usr/bin/perl -w use strict; use Data::Dumper qw(Dumper); my %hash; while (my $line = ) { next unless my ($id, @row) = $line =~ /^(\d+) (\w+) (\S+) (\w+) (\w+)$/; @{$hash{$id}}{qw(name email title date)} = @row; } print Dumper(\%hash); __DATA__ 1 merlyn merlyn@perlmonks.org saint today 2 tilly tilly@perlmonks.org saint today 3 tye tye@perlmonks.org saint today 4 jcwren jcwren@perlmonks.org saint today #### my %hash; my %account; @account{ qw(name email title date) } = @row; $hash{$id} = \%account;