Since you had requested it, here is a corrected version of your program:
use strict;
use warnings;
my $in_file = 'check.doc';
open my $in_fh, '<', $in_file or die "Could not open file $in_file: $!
+";
my $out_file = 'output.txt';
open my $out_fh, '>', $out_file or die "Could not open file $out_file:
+$!";
my $print_next = 0;
while ( my $line = <$in_fh> )
{
if ($print_next){
print $out_fh $line; #No need to chomp - we print the "\n"
}
$print_next = ($line =~ /^Customer ID: Yes/);
}
close $in_fh or die "Could not close file $in_file: $!";
close $out_fh or die "Could not close file $out_file: $!";
You can add the other features using code that is posted above.
BTW, congrats on using the "correct" form of "open" and "close".
"XML is like violence: if it doesn't solve your problem, use more."