in reply to Parsing and searching HTML code

Your strings should also be "quoted" by \Q...\E in case they contain any special characters: $html =~ m/(\Q$search_start\E.+\Q$search_end\E)/si;

I suggest using HTML::TreeBuilder and look_down method of HTML::Element.

Sorry if my advice was wrong.

Replies are listed 'Best First'.
Re^2: Parsing and searching HTML code
by Kenosis (Priest) on Jul 26, 2012 at 17:35 UTC

    Good catch--thank you. Have updated the code.

Re^2: Parsing and searching HTML code
by jayto (Acolyte) on Jul 26, 2012 at 17:47 UTC
    I thought that if strings are contained in variables then they don't need to quoted. Also one question Kenosis, in this statement /(\Q$search_start\E.*?\Q$search_end\E)/s;, I realized that the ? after the .* is important. What does it do?

      That prevents the regex from being greedy, else the match would end at the very last $search_end--way beyond what you wanted.