use strict; use Data::Dump qw(dump); use Carp; my $res = {}; # Results my $i = 1; while(my $line = ){ $line =~ /\((.*)\)/; my @in = split /\s+/, $1; my $s = qq($i => {$in[1] => "$in[2]", $in[5] => "$in[6]"}); #print "$s\n"; my $ref = eval($s) or croak "$@\n"; $res->{$i} = $ref; $i++; } print dump $res; __END__ Wed Mar 23 13:00:28 2011 : Auth: Login OK: [00-11-0A-FA-FB-AA/NOPASSWORD] (from client kgn751 port 31045 cli 00-11-0A-FA-FB-AA) Wed Mar 23 13:01:02 2011 : Auth: Login OK: [00-0B-5D-0B-D6-44/NOPASSWORD] (from client WabeN7-55 port 11031 cli 00-0B-5D-0B-D6-44) Wed Mar 23 13:01:22 2011 : Auth: Login OK: [00-00-85-7B-44-F7/NOPASSWORD] (from client e1-110-west port 36 cli 00-00-85-7B-44-F7) Wed Mar 23 13:01:37 2011 : Auth: Login OK: [00-C4-FF-7F-34-07/NOPASSWORD] (from client e1-111-west port 76 cli 00-C4-FF-7F-34-07) Wed Mar 23 13:05:29 2011 : Auth: Login OK: [08-37-FF-0C-E7-39/NOPASSWORD] (from client e1-140-west port 3 cli 08-37-FF-0C-E7-39)