my @array = (split/\n/, $data); my $firstmatch = $array[3]; my $secondmatch = $array[4];