I have written a few modules that use XML::Parser. I also want them to use utf8; so that my code will be unicode friendly (for at least one of these, it is necessary, as I it stores and retrieves translation tables). But for some reason one of my handlers for the xml parser seems to be giving the utf8 code issues:

Can't locate object method "IsSpace" via package "main" at C:/Perl/lib/utf8_heavy.pl line 30.

i traced it back to where it's getting invoked from my code, and it's the last line of my character handler:

sub _parseChar { my( $parser,$string ) = @_; if( $state_stack[-1] =~ /dataType|label|op|sep/ ) { $value .= $string; } else { csWarn( class=>csErrorClass('CODE_PARAMS'),severity=>csErrorSc +ale('MODERATE'), message => 'illegal syntax in Resource File', debug => "illegal syntax: bare string '$string' out of + context") and return undef unless $string =~ /\s+/; <=== here } }
I am not sure why this is happening... any ideas?

In reply to XML::Parser and the utf8 Pragma by AidanLee

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.