in reply to extract_tagged

Is this extract_tagged from Text::Balanced? Text::Balanced is a set of tokenizing functions for parsers. Tokenizers extract from the current position in the string/stream, so these function can't be used to match something that may occur later in the string. In other words, your string doesn't start with <a href=" (it starts with <li><a href="), so nothing is extracted.

I don't know what to suggest as a replacement, but I'm sure someone else will be suggesting a module better suited to what you are doing.

Replies are listed 'Best First'.
Re^2: extract_tagged
by yacoubean (Scribe) on Sep 29, 2004 at 15:32 UTC
    You are the holiest Monk of them all. At lest of those that responded. :) davido's and mifflin's suggestions probably would have worked, but it was much easier to just change my code to:

    if (/<a href\=\"/) { my @link = extract_tagged($_, '<li><a href="', '">', undef, undef); print " @link[4]\n"; }

    That worked like a charm.