in reply to Re^4: 3 capture multi line regex
in thread 3 capture multi line regex

your code does a very strange thing: you AT FIRST put a string "$1::$2::$3" into array and then perform search!

Use a cycle :)

push (@results, "$1::$2::$3") while $result_content =~ /$regex/g;
or a cleaner but IMO more ugly code:
while ($result_content =~ /$regex/g) { push (@results, "$1::$2::$3"); }

Replies are listed 'Best First'.
Re^6: 3 capture multi line regex
by Anonymous Monk on Jun 30, 2006 at 22:28 UTC
    I was told recently that doing a while on the var with the HTML code can create endless loops and it's a bad thing though.