my $infile = ; print"Your input file is $infile\n\n"; my $outfile = "out.log"; open (INFILE, "<$infile")||die "no such file"; open (LOG, ">$outfile")||die "no such file"; while () { if (/^Begin Targets/ .. /^End Targets/) { next unless /^\d/; push @data, [split /\s/]; } count++; }