in reply to Counting the number of replaces
while( <$inputfh> ) { $replcount += s/replacethis/withthis/g; print $outputfh $_; } [download]
-M
Free your mind