while () { chomp($_); # Look for title line if ($_ =~/Start -/) { my @sdk_line = split(/\t/, $_); push(@temp, substr($sdk_line[1], 18)); } } while () { chomp($_); # find process time for that title if ($_ =~/Process/) { print split(/\t/, $_), "\n"; my @sdk_line = split(/\t/, $_); push(@temp , $sdk_line[2]); } } #### for my $fn (@file_names){ open my $handle, '<', $fn or die "Can't open `$fn' for reading: $!"; # do something with the file here # and write to output file close $fn; }