Or just look up the XML to do what you want:

<?xml version="1.0" encoding="UTF-8"?> <w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingm +l/2006/main" xmlns:m="http://schemas.openxmlformats.org/officeDocumen +t/2006/math" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns: +r="http://schemas.openxmlformats.org/officeDocument/2006/relationship +s" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:ve="http://schemas.o +penxmlformats.org/markup-compatibility/2006" xmlns:w10="urn:schemas-m +icrosoft-com:office:word" xmlns:wne="http://schemas.microsoft.com/off +ice/word/2006/wordml" xmlns:wp="http://schemas.openxmlformats.org/dra +wingml/2006/wordprocessingDrawing"> <w:body> <w:p w:rsidR="00D479B1" w:rsidRDefault="00D479B1"> <w:r> <w:t>1234</w:t> </w:r> </w:p> <w:p w:rsidR="00D479B1" w:rsidRDefault="00D479B1"> <w:r> <w:t>5678</w:t> </w:r> </w:p> <w:sectPr w:rsidR="00D479B1" w:rsidSect="00D479B1"> <w:pgSz w:w="11906" w:h="16838" /> <w:pgMar w:top="1440" w:right="1800" w:bottom="1440" w:left=" +1800" w:header="708" w:footer="708" w:gutter="0" /> <w:cols w:space="708" /> <w:docGrid w:linePitch="360" /> </w:sectPr> </w:body> </w:document>

becomes:

<?xml version="1.0" encoding="UTF-8"?> <w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingm +l/2006/main" xmlns:m="http://schemas.openxmlformats.org/officeDocumen +t/2006/math" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns: +r="http://schemas.openxmlformats.org/officeDocument/2006/relationship +s" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:ve="http://schemas.o +penxmlformats.org/markup-compatibility/2006" xmlns:w10="urn:schemas-m +icrosoft-com:office:word" xmlns:wne="http://schemas.microsoft.com/off +ice/word/2006/wordml" xmlns:wp="http://schemas.openxmlformats.org/dra +wingml/2006/wordprocessingDrawing"> <w:body> <w:p w:rsidR="00D479B1" w:rsidRDefault="00D479B1"> <w:r> <w:t>1234</w:t> </w:r> </w:p> <w:p> <w:r> <w:br w:type="page" /> </w:r> </w:p> <w:p w:rsidR="00D479B1" w:rsidRDefault="00D479B1"> <w:r> <w:t>5678</w:t> </w:r> </w:p> <w:sectPr w:rsidR="00D479B1" w:rsidSect="00D479B1"> <w:pgSz w:w="11906" w:h="16838" /> <w:pgMar w:top="1440" w:right="1800" w:bottom="1440" w:left=" +1800" w:header="708" w:footer="708" w:gutter="0" /> <w:cols w:space="708" /> <w:docGrid w:linePitch="360" /> </w:sectPr> </w:body> </w:document>

See also the other links already provided in this thread, and their associated links. To be honest your work flow ('I'm using Perl to scrape text from a JavaScript that printed out one page at a time..') seems somewhat convoluted, but you don't go into much detail.


In reply to Re^4: Can Perl generate a page break character that Microsoft Word will recognize? by marto
in thread Can Perl generate a page break character that Microsoft Word will recognize? by Intermediate Dave

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.