my @issues; while () { push @issues, { Id => $1 } if /^ISSUE\s+(\w{5}\d+)$/; $issues[-1]->{$1} = $2 if /^(\w+)\s*:\s+(.+)$/ } dd \@issues;