while (<__DATA__>) { # I don't know how to calculate the length $# of __DATA__ # so I just put 10 in there instead. for($i = 0; $i < 10; $i++) { if($data[$i] =~ m/KB[0-9]/) { do { push(@temp, $data[$i]); $i++; }while ($data[$i] =~ m/KB[0-9]/); } } # For some reason the loop is loading the whole file # into @temp print "@temp\n"; } __DATA__ "Information","17","4/13/2006 12:54:25 PM","Windows Update Agent","ISA","Installation","N/A","Installation Ready: The following updates are downloaded and ready for installation. To install the updates, an administrator should log on to this computer and Windows will prompt with further instructions: - Security Update for Windows Server 2003 (KB911562) - Windows Malicious Software Removal Tool - April 2006 (KB890830) - Cumulative Security Update for Internet Explorer for Windows Server 2003 (KB912812) - Security Update for Windows Server 2003 (KB908531) - Cumulative Security Update for Outlook Express for Windows Server 2003 (KB911567)" "Information","17","4/13/2006 12:54:19 PM","Windows Update Agent","ISA","Installation","N/A","Installation Ready: The following updates are downloaded and ready for installation. To install the updates, an administrator should log on to this computer and Windows will prompt with further instructions: - Security Update for Windows Server 2003 (KB911562) - Windows Malicious Software Removal Tool - April 2006 (KB890830) - Cumulative Security Update for Internet Explorer for Windows Server 2003 (KB912812) - Security Update for Windows Server 2003 (KB908531)"