I am trying to create an Open Office Document with Hebrew characters within it.
I have a separate file defining the Hebrew characters, and the file to create the Open Office Document.

myHebrew.pl
use charnames (); #URL: http://perldoc.perl.org/perluniintro.html #URL: https://en.wikipedia.org/wiki/Unicode_and_HTML_for_the_Hebrew_al +phabet our $alef = charnames::string_vianame("HEBREW LETTER ALEF"); our $bet = charnames::string_vianame("HEBREW LETTER BET"); our $gimel = charnames::string_vianame("HEBREW LETTER GIMEL"); our $dalet = charnames::string_vianame("HEBREW LETTER DALET"); our $he = charnames::string_vianame("HEBREW LETTER HE"); our $vav = charnames::string_vianame("HEBREW LETTER VAV"); our $zayin = charnames::string_vianame("HEBREW LETTER ZAYIN"); our $het = charnames::string_vianame("HEBREW LETTER HET"); our $tet = charnames::string_vianame("HEBREW LETTER TET"); our $yod = charnames::string_vianame("HEBREW LETTER YOD"); our $final_kaf = charnames::string_vianame("HEBREW LETTER FINAL KAF"); our $kaf = charnames::string_vianame("HEBREW LETTER KAF"); our $lamed = charnames::string_vianame("HEBREW LETTER LAMED"); our $final_mem = charnames::string_vianame("HEBREW LETTER FINAL MEM"); our $mem = charnames::string_vianame("HEBREW LETTER MEM"); our $final_nun = charnames::string_vianame("HEBREW LETTER FINAL NUN"); our $nun = charnames::string_vianame("HEBREW LETTER NUN"); our $samekh = charnames::string_vianame("HEBREW LETTER SAMEKH"); our $ayin = charnames::string_vianame("HEBREW LETTER AYIN"); our $final_pe = charnames::string_vianame("HEBREW LETTER FINAL PE"); our $pe = charnames::string_vianame("HEBREW LETTER PE"); our $final_tsadi = charnames::string_vianame("HEBREW LETTER FINAL TSAD +I"); our $tsadi = charnames::string_vianame("HEBREW LETTER TSADI"); our $qof = charnames::string_vianame("HEBREW LETTER QOF"); our $resh = charnames::string_vianame("HEBREW LETTER RESH"); our $shin = charnames::string_vianame("HEBREW LETTER SHIN"); our $tav = charnames::string_vianame("HEBREW LETTER TAV"); our $geresh = charnames::string_vianame("HEBREW PUNCTUATION GERESH"); our $gershayim = charnames::string_vianame("HEBREW PUNCTUATION GERSHAY +IM"); 1;

and "createOODoc.pl"

#!/usr/bin/perl -w use strict; use warnings; require "myHebrew.pl"; our ($alef, $bet, $gimel, $dalet, $he, $vav, $zayin, $het, $tet, $yod, $final_kaf, $kaf, $lamed, $final_mem, $mem, $final_nun, $nun, $samekh, $ayin, $final_pe, $pe, $final_tsadi, $tsadi, $qof, $resh, $shin, $tav, $geresh, $gershayim); use OpenOffice::OODoc; use utf8; my $header = $bet . $samekh . $gershayim . $dalet; my $doc = odfDocument( file => "Parsha.odt", create => 'text' ); my $p = $doc->appendParagraph( text => "", style => "optionalParagraphStyle" ); $doc->extendText($p, $header); $p = $doc->appendParagraph(text => $header, style => "optionalParagraphStyle" ); $doc->save; exit 0; ### End of File ###

When I run this, I get

Use of uninitialized value in lc at C:/Perl64/site/lib/OpenOffice/OODoc/File.pm line 378.

Cannot decode string with wide characters at C:/Perl64/lib/Encode.pm line 176.

What am I doing wrong? Can someone help me correct this?

In reply to Creating Open Office Doc with Hebrew by sachss

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.