in reply to Why are lines being skipped in output?

I'll include the entire thing here and --sorry I'm still not with the wiki style for 'code' tags. I'll get it eventually.
#!usr/bin/env perl open (test, "@ARGV"); while (<test>) { $_ =~ <test>; chomp; s/(th)/TH/gi; print "$_\n"; } close (test);
The open is for reading and surely you mean
open(test, "<$ARGV[0]"); # what happens when more args?
This, I believe is the issue so instead of this
s/(th)/TH/gi;
try this
s/th/TH/go;
Its likely that a simpler
tr/th/TH/;
might work.

Replies are listed 'Best First'.
Re^2: Why are lines being skipped in output?
by Anonymous Monk on Mar 20, 2008 at 08:33 UTC

    tr/th/TH/; won't work as required, it replaces every t with a T and every h with an H, even those that are not part of a th.

    Alexander