my(@records, $ref); while() { chomp; if(my @fields = /^(\S+): \[(.+?)\] \[(.+?)\] \[(.+?)\] \[(.+?)\]\s*$/) { my %record; @record{'ticket#', qw(customer status priority owner)} = @fields; push @records, $ref = \%record; } elsif(s/^\s+//) { if(defined $ref->{summary}) { $ref->{summary} .= "\n$_"; } else { $ref->{summary} = $_; } } else { warn "Oops: no match in: $_\n"; } } use Data::Dumper; print Dumper \@records; __DATA__ fabx-t160: [ggurudut] [UNAN/OWNR] [C2] [kelrod] navicli chglun -l 3 -name "newname" doesn't work fabx-t161: [dozone] [UNAN/OWNR] [C2] [dchoi] The GUI needs to hide the CPP SEs from the unimported list fabx-t162: [haurora] [UNAN/OWNR] [C1] [glade] Cisco hardware related bug :idprom error on cisco switch on loading 0.1.5.5 salagent (This line won't match) #### Oops: no match in: (This line won't match) $VAR1 = [ { 'summary' => 'navicli chglun -l 3 -name "newname" doesn\'t work', 'status' => 'UNAN/OWNR', 'customer' => 'ggurudut', 'ticket#' => 'fabx-t160', 'owner' => 'kelrod', 'priority' => 'C2' }, { 'summary' => 'The GUI needs to hide the CPP SEs from the unimported list', 'status' => 'UNAN/OWNR', 'customer' => 'dozone', 'ticket#' => 'fabx-t161', 'owner' => 'dchoi', 'priority' => 'C2' }, { 'summary' => 'Cisco hardware related bug :idprom error on cisco switch on loading 0.1.5.5 salagent', 'status' => 'UNAN/OWNR', 'customer' => 'haurora', 'ticket#' => 'fabx-t162', 'owner' => 'glade', 'priority' => 'C1' } ];