in reply to Grabbing part of an HTML page

To fix the problem change this line:
-    while(@files_to_look_in)
+    foreach ( @files_to_look_in )

Edit:
Instead of writing   if($_=~/$start_pattern/i)   you can simply do   if ( m/$start_pattern/i )   omitting   $_.

Edit 2:
I think you also need to change this:
-     open(HTM_FILE, <$_);
+     open( HTM_FILE, "< $_" );

Replies are listed 'Best First'.
Re: Grabbing part of an HTML page
by kingdean (Novice) on Mar 28, 2004 at 22:46 UTC
    Tried that. It didn't work. :( Thanks Dean

      Tried that. It didn't work.

      I tried that too, before posting here. And it worked fine.
      But I also made sure the strings you were looking for exist in the test data.

      my test data:

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

      the test script in readmore: