Thanks!#!/usr/bin/perl -w use diagnostics; use strict; use HTML::TokeParser; my $filename = '/Users/peternelson/Desktop/atdstudy.html'; my $stream = HTML::TokeParser->new($filename) || die "Couldn't read HTML file $filename: $!"; while (my $token = $stream->get_token) { LOOK: { if ($token->[0] eq 'C' and $token->[1] eq '<!-- InstanceBeginEdita +ble name="article" -->') { goto PARSE; } else { next; } }#end look PARSE: { if ($token->[0] eq 'C' and $token->[1] eq '<!-- InstanceEnd -->') +{ exit; } elsif ($token->[0] eq 'T') { print $token->[1]; } next PARSE; }#end parse }
In reply to Extracting HTML between comments by pnelson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |