Try this, but beware of:
#! /usr/bin/perl -w use strict; my $start_pattern = '<!-- start section-->'; my $end_pattern = '<!-- end section -->'; my @files_to_look_in = ('/path/to/files1.html', '/path/to/files2.html' +); my $write_line = 0; foreach (@files_to_look_in) { open HTM_FILE, "<$_"; while (<HTM_FILE>) { $write_line = 1 if /$start_pattern/i; $write_line = 0 if /$end_pattern/i; print $_, "\n" if $write_line; } close HTM_FILE; }
In reply to Re: Grabbing part of an HTML page
by pbeckingham
in thread Grabbing part of an HTML page
by kingdean
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |