in reply to Grabbing part of an HTML page

Now I think about it, it appears that perhaps your starting and ending patterns may be at fault - they are inconsistently formed. Note the space between the word 'section' and the '-->'.

<!-- start section--> <!-- end section -->

Replies are listed 'Best First'.
Re: Re: Grabbing part of an HTML page
by kingdean (Novice) on Mar 29, 2004 at 01:51 UTC
    I even tried this with no <-- or -->. I tested it with an html file that just has start section blah end section And it still didn't work. :(
      You have answered back to a number of replies now, saying you've tried their ideas and it didn't work. Maybe it would be worth while replying to your own root node with the code as it stands now, so folks can see whether you've followed their ideas as intended.

      Have you changed your outer loop and open statement yet? Let me suggest that it should now look like this:

      for my $file ( @files_to_look_in ) { open( HTML_FILE, "<$file" ) or die "Can't open $file for input: $!" +; ...
      If you don't have the "or die ...", then the failure might be a matter of not opening the file -- Perl won't generate an error on an open statement that fails, unless you explicitly test to see if it succeeds, and tell it what to say and do when it fails.