for my $chunk (split "\n\n", $data) { my ($if) = $chunk =~ m/^(\S+)/; my ($status) = $chunk =~ m/status:\s*(\S+)/; print "$if: $status\n"; }