while($data =~ m/\n\s*(\w+)\s+(.*);/g){ my $typ = $1; my $dat = $2; print "$typ::$dat>>\n"; }