in reply to How do I read the contents of an HTML file between two BODY tags?
The if (/regexp/.../regexp2/) evaluates to true if $_ is between the two regexp (even across lines)open(HTML,"test.html") || die "cant open file\n"; while(<HTML>){ if(/<body.*?>/i ... /<\/body.*?>/i){ print OUTFILE $_; } } close HTML;
sweet
Diarmiuid
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I read the contents of an HTML file between two BODY tags?
by FloydATC (Deacon) on Jun 30, 2007 at 12:06 UTC |