if ($rpt[$ln] =~ /^\sStartpoint/ { @ptlalsp = split(/\s+/,$rpt[$ln]); $ptsp = $ptlalsp[2]; #get name do { $ln++; } until ($rpt[$ln] =~ /$ptsp/); #name will show up #again...increment #$ln until found #other stuff... }