http://qs321.pair.com?node_id=674784


in reply to Why are lines being skipped in output?

Change:
while (<test>) { $_ =~ <test>; chomp; s/(th)/TH/gi; print "$_\n"; }
To:
while (<test>) { s/th/TH/gi; print; }
and it should work.