in reply to Substr warning

After your code acts upon the first HTML file, do you ever reset $ch_count to zero, or does it keep on getting incremented larger and larger with each subsequent file? The code snippet you've provided doesn't tell us that. Also, is $ch_count starting out being undef initially?

In particular, the first scenario could get you into trouble. If you're acting upon multiple files, and $ch_count has grown to some value that exceeds the length of the postmatch string, you've got a problem.


Dave

Replies are listed 'Best First'.
Re^2: Substr warning
by Anonymous Monk on Sep 27, 2004 at 11:07 UTC
    Hi,

    I always reset ch_count. I use this structure of code for a number of occasion and each time I reset ch_count.