<p>
    <strong>Solution</strong>: Luckily they are ODF files, ODF is a zipped XML, a <a href="http://search.cpan.org/dist/OpenOffice-OODoc/OODoc.pod">PERL module</a> exists to do incredible tricks.
  </p>
  
  <p>
    I have then made this basic script, just tweaking the example provided:
  </p>
  
  <pre>

#/bin/perl! #filename to be passed as an argument use OpenOffice::OODoc;

                    # get global access to the content of an ODF file
    my $document = odfDocument(file =&gt; $ARGV[0] );
                    # select a text element containing a given string
    my $place = $document-&gt;getParagraph(0);
                    # insert a new text element before the selected one
    my $newparagraph = $document-&gt;insertParagraph
                    (
                    $place,
                    position        =&gt; &#039;before&#039;,
                    text            =&gt; &#039;A COOL new paragraph to be inserted 
                                        at the beginning of the file&#039;,
                    style           =&gt; &#039;Text body&#039;
                    );
    
            # save the modified document
    $document-&gt;save;

  <p>
    I know it is slightly less than a hack, but do that with a MS Word document.
  </p>
  
  <p>
    Installing the module is pretty straightforward, it only requires an additional module to manage zip files, as dependancy, on my Ubuntu 10.10 standard PERL installation.
  </p>
  
  <p>
    Many Thanks to <strong>Ingolf Schaefer</strong> (@<a href="mailto:ovidius@identi.ca">ovidius@identi.ca</a>) for the hints. Also <strong>Giuseppe Maxia</strong> pointed in the right direction.
  </p>
</div>
<div class="field-item odd">
  <a href="/taxonomy/term/37">InteroperabilitĂ </a>
</div>