# open a file my $filename = $ARGV[0]; open(debugfile, $filename) || die "Sorry, couldn't open file!"; while($line = ) { if($line =~ /##BEEP/) # place the regular expression to match the first line here { print $line; @firstLine = split(/\)/, $line); $firstLineTime = $firstLine[1]; @match = split (/##/, $firstLineTime); $Tic = $match[0]; $waitingForTargetStatement = 1; # print "$firstLineTime\n"; # print "$Tic\n"; next; } if($line =~ /Pick/ && $waitingForTargetStatement == 1) # place the regular expression to match the second line here { $waitingForTargetStatement = 0; @secondLine = split(/\)/, $line); $secondLineTime = $secondLine[1]; @match = split (/##/, $secondLineTime); $Tic = $match[0]; $time = $secondLineTime - $firstLineTime; $time = $time/1000; print $line; # print "$Tic\n"; print "The time between the beep and the next pick location is $time seconds\n"; # modify the print statement print "\n"; next; } # if($line =~ /##|\^\^|SYSMSG|DIALOG/) # place a regular expression to include other desired content here. # { # print $line; # } }