in reply to Re: Re: Text::Balanced woes..
in thread Text::Balanced woes..

That loop can be simplified:

  1. Don't bother doing the counting yourself when Perl will do it for you.
  2. You don't actually need the temporary array — you can grab a single element from a list.

This is untested, since I don't have sample data handy, but I reckon does the same as your loop and is a little simpler:

foreach my $datum (@data) { $datum = (extract_tagged($datum, '<a href="http://', '">'))[4]; }

Smylers