in reply to Why are lines being skipped in output?

Hi, ignoring other issues in your script: your problem is located at:
# read linewise from handle test to $_
while (<test>) {
    # read again one line from handle test
    $_ =~ <test>;
    chomp;
    s/(th)/TH/gi;
    print "$_\n";
}
Solution:
while ( my $line = <test> ) {
  $line =~ s/th/TH/gi;
  print $line;
}
  • Comment on Re: Why are lines being skipped in output?