in reply to Re: Regex to select multiple lines
in thread Regex to select multiple lines

Okie after reviewing the replies to my question, thanks to all of you. I came up with this.
sub chewitup { for($i=0; $i<$array_size; $i++){ chomp($data[$i]); if($data[$i] =~ /Message Type:/){ @details0=split / /, $data[$i]; unless($data[$i] eq $blank){ if($data[$i] =~ /Error Code:/){ @details2=split / /, $data[$i]; } if($data[$i] =~ /Transaction Time:/){ @details1=split / /, $data[$i]; } next $i; } $txname=$details0[2]; $txtime=$details1[2]; $errorcode=$details2[2]; print OUT "$txname\t\t\t$txtime\t\t$errorcode\n"; } } }

Opinions please...thanks