Posted on 2005-10-27 01:41:34-07 by bob in response to 1171
Re: Delete-to-End of Document
Works for me:
my $delete_rest; my @paragraphs=$content->getParagraphList(); #need to save the first few in order to preserve headers and footers @paras=@paragraphs[4..$#paragraphs]; for my $para (@paragraphs) { my $text= $content->getText($para); $delete_rest++ if $text=~/DELETE TO END/; next unless $delete_rest; $content->removeParagraph($para); } $content->save
Direct Responses: 1255 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.