in reply to Re^2: Concatenating scripts intelligently
in thread Concatenating scripts intelligently

I figured you'd want something like that. You'll probably want to handle warnings too. local $SIG{__WARN__} will help you do that.

An improvement I see is to optimize the line count to only count from the point where last count left off.