in reply to foreach loop with nested

I think the /g modifier is messing you up. You never finish the iteration, so the next match against the same string will find the next match, which fails if there is only one. So the if line you added "eats" the match and then the next line sees no more matches available.

try

if ($content =~ /$company(.*?)<\/tr>/smi) { $new coverage= $1; #etc }

Replies are listed 'Best First'.
Re: Re: foreach loop with nested
by cdherold (Monk) on Aug 02, 2001 at 08:09 UTC
    john,

    that /g modifier was the problem ... thanks very much.

    chris