use strict; use warnings; use Data::Dumper; local $/ = "\n\n\n"; while () { next unless m/Dumpdata example/; my %row = m/ ^ \s* (\w+:) \s+ ( (?: (?!^\s*\w+:) . )+ ) /xmsg; print Dumper(\%row); } __DATA__ Dumpdata example ----------------- Warning bad news here Detail: Some really nice infos these are Info: This is a problem but there is a solution #### $VAR1 = { 'Detail:' => 'Some really nice infos these are ', 'Info:' => 'This is a problem but there is a solution ' };