The respective piece of code that populates @Encoding_Path looks like

if ($have_File_Spec) { @Encoding_Path = (grep(-d $_, map(File::Spec->catdir($_, qw(XML Parser Enco +dings)), @INC)), File::Spec->curdir); } else { @Encoding_Path = (grep(-d $_, map($_ . '/XML/Parser/Encodings', @INC +)), '.'); }

so it should work if you put the file in "the current directory", or in one of the @INC dirs with /XML/Parser/Encodings appended. If you try '.', note that if this a CGI script, the current directory may not be what you think it is... (in case of doubt, chdir()).

Alternatively, I think you can explicitly call XML::Parser::Expat::load_encoding(ENCODING) and specify an absolute path to the file as ENCODING.  From Expat.pm:

=item XML::Parser::Expat::load_encoding(ENCODING) Load an external encoding. ENCODING is either the name of an encoding +or the name of a file. The basename is converted to lowercase and a '.enc +' extension is appended unless there's one already there. Then, unless it's an absolute pathname (i.e. begins with '/'), the first file by th +at name discovered in the @Encoding_Path path list is used. (...) The only reason users should use this function is to explicitly load an encoding not contained in the @Encoding_Path list.

In reply to Re^4: Error with .xml file processing in XML::Simple by almut
in thread Error with .xml file processing in XML::Simple by Anonymous Monk

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.