Envirnoment (?) question

Discussion in 'Perl Misc' started by Thumain Th., Nov 6, 2008.

  1. Thumain Th.

    Thumain Th. Guest

    Hi,

    Sorry with this strange problem.
    We use XML::Simple to parse small xml files.
    Program was shortened to

    use strict;
    use XML::Simple;
    my $ref=XMLin('/var/tmp/file.xml')

    On one of our systems XMLin crashes with 'illecal xml character' (file.xml
    is OK).

    BUT:
    With perl debugger the $ref=XMLin(...) runs OK
    AND:
    With perl debugger if the $ref=XMLin(...) is run before typing c for
    running program
    the program runs OK.

    We suppose something is wrong with XML module installation , but why can
    the debugger
    run and not program ?

    Thanks for any idea.
    --
    TT
    Thumain Th., Nov 6, 2008
    #1
    1. Advertising

  2. "Thumain Th." <> writes:

    > Hi,
    >
    > Sorry with this strange problem.
    > We use XML::Simple to parse small xml files.
    > Program was shortened to
    >
    > use strict;
    > use XML::Simple;
    > my $ref=XMLin('/var/tmp/file.xml')
    >
    > On one of our systems XMLin crashes with 'illecal xml character'
    > (file.xml is OK).


    The error you're getting says that the file is not OK. Have you used a
    different tool to verify that the XML is in fact well-formed and (if it
    has a DTD) valid?

    sherm--

    --
    My blog: http://shermspace.blogspot.com
    Cocoa programming in Perl: http://camelbones.sourceforge.net
    Sherm Pendley, Nov 6, 2008
    #2
    1. Advertising

  3. Thumain Th. <> wrote:

    > On one of our systems XMLin crashes with 'illecal xml character' (file.xml
    > is OK).



    Please copy and paste error messages rather than attempting to retype them.


    --
    Tad McClellan
    email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
    Tad J McClellan, Nov 6, 2008
    #3
  4. On 2008-11-06, Thumain Th. <> wrote:
    *SKIP*

    > On one of our systems XMLin


    Please explain difference between 'one of' and 'our systems'.

    > crashes with 'illecal xml character' (file.xml is OK).


    Please copy-paste exact and full messages.

    *CUT*

    --
    Torvalds' goal for Linux is very simple: World Domination
    Eric Pozharski, Nov 7, 2008
    #4
  5. Thumain Th.

    Thumain Th. Guest

    Le Thu, 06 Nov 2008 18:31:40 +0100, Sherm Pendley <> a
    écrit:

    > "Thumain Th." <> writes:
    >
    >> Hi,
    >>
    >> Sorry with this strange problem.
    >> We use XML::Simple to parse small xml files.
    >> Program was shortened to
    >>
    >> use strict;
    >> use XML::Simple;
    >> my $ref=XMLin('/var/tmp/file.xml')
    >>
    >> On one of our systems XMLin crashes with 'illecal xml character'
    >> (file.xml is OK).

    >
    > The error you're getting says that the file is not OK. Have you used a
    > different tool to verify that the XML is in fact well-formed and (if it
    > has a DTD) valid?
    >
    > sherm--
    >

    Yes it is , and is parsed OK under debugger.


    --
    TT
    Thumain Th., Nov 7, 2008
    #5
  6. Thumain Th.

    Thumain Th. Guest

    Le Thu, 06 Nov 2008 21:51:21 +0100, Tad J McClellan <>
    a écrit:

    > Thumain Th. <> wrote:
    >
    >> On one of our systems XMLin crashes with 'illecal xml character'
    >> (file.xml
    >> is OK).

    >
    >
    > Please copy and paste error messages rather than attempting to retype
    > them.
    >
    >

    Thanks for your answer , here is 1st line of STDERR:
    XML::SAX::Exception::throw('XML::SAX::Exception::parse', 'Message',
    'Not a v
    alid XML character: \'=\'') called at
    /usr/lib/perl5/vendor_perl/5.8.6/XML/
    SAX/PurePerl/Reader.pm line 92
    XML::SAX::purePerl::Reader::match('XML::SAX::purePerl::Reader::Stream=ARRAY(
    0x890df10)', '=') called at
    /usr/lib/perl5/vendor_perl/5.8.6/XML/SAX/PurePerl/XM
    LDecl.pm line 52

    I did not insert error message since same program and file correctly
    function on
    other systems. Trying to find why on THIS system ,file parses OK under
    debugger not in program with
    same instructions.



    --
    TT
    Thumain Th., Nov 7, 2008
    #6
  7. Thumain Th.

    Guest

    On Fri, 07 Nov 2008 07:43:52 +0100, "Thumain Th." <> wrote:

    >Le Thu, 06 Nov 2008 18:31:40 +0100, Sherm Pendley <> a
    >écrit:
    >
    >> "Thumain Th." <> writes:
    >>
    >>> Hi,
    >>>
    >>> Sorry with this strange problem.
    >>> We use XML::Simple to parse small xml files.
    >>> Program was shortened to
    >>>
    >>> use strict;
    >>> use XML::Simple;
    >>> my $ref=XMLin('/var/tmp/file.xml')
    >>>
    >>> On one of our systems XMLin crashes with 'illecal xml character'
    >>> (file.xml is OK).

    >>
    >> The error you're getting says that the file is not OK. Have you used a
    >> different tool to verify that the XML is in fact well-formed and (if it
    >> has a DTD) valid?
    >>
    >> sherm--
    >>

    >Yes it is , and is parsed OK under debugger.


    I wouldn't think Simple requires DTD or any thing else.
    In fact I know thats not the case. I don't know the default
    parser Simple uses, but Simple is not in itself a parser.

    I never passed it a file name. Does it do that? Usually an open file
    handle is passed in leu of an xml string. Pass some junk xml string and
    see if it works. Some content at root level. Try to invoke an exception.

    Try these two lines:

    use XML::Simple;
    $XML::Simple::pREFERRED_PARSER = 'XML::parser';

    I never use Simple anymore, I have my own complete package I have
    written with many tools. Man that Expat though, its nightmare fast
    but has got nothing else.

    sln
    , Nov 7, 2008
    #7
  8. Thumain Th.

    Thumain Th. Guest

    Re: Envirnoment (?) question [LONG]

    Le Fri, 07 Nov 2008 01:00:44 +0100, Eric Pozharski <>
    a écrit:

    > On 2008-11-06, Thumain Th. <> wrote:
    > *SKIP*
    >

    Thanks for your answer , s

    >> On one of our systems XMLin

    >
    > Please explain difference between 'one of' and 'our systems'.
    >

    Excellent question!
    Same file and program runs OK on all our systems but not on THIS one.
    THIS system is Suse 9.3 , perl 5.8.6 and old 5.000503 leaves
    in/usr/local/lib/perl5/... , development
    environment was migrated to this machine , perl 5.8.6 was installed and
    many modules (including XML , ...)
    were just copied from original /usr/local/lib/perl5/5.0000503 to same
    directories (ie NOT 5.8.6) on this
    system. They seem to function OK.

    Other systems are RH 7.2/perl 5.000503 ,RH 6 and other linux flavors.

    One of our customers runs same system as THIS and program and file run OK
    on it...

    >> crashes with 'illecal xml character' (file.xml is OK).

    >
    > Please copy-paste exact and full messages.
    >
    > *CUT*
    >



    XML::SAX::Exception::throw('XML::SAX::Exception::parse', 'Message',
    'Not a v
    alid XML character: \'=\'') called at
    /usr/lib/perl5/vendor_perl/5.8.6/XML/
    SAX/PurePerl/Reader.pm line 92
    XML::SAX::purePerl::Reader::match('XML::SAX::purePerl::Reader::Stream=ARRAY(
    0x890df10)', '=') called at
    /usr/lib/perl5/vendor_perl/5.8.6/XML/SAX/PurePerl/XM
    LDecl.pm line 52

    I did not insert error message since same program and file correctly
    function on
    other systems. Trying to find why on THIS system ,file parses OK under
    debugger not in program with
    same instructions.

    Thanks for time spent reading posts....

    --
    TT
    Thumain Th., Nov 7, 2008
    #8
  9. Thumain Th.

    Thumain Th. Guest

    Le Fri, 07 Nov 2008 08:33:28 +0100, <> a écrit:

    > On Fri, 07 Nov 2008 07:43:52 +0100, "Thumain Th."
    > <> wrote:
    >

    [...]
    >>> The error you're getting says that the file is not OK. Have you used a
    >>> different tool to verify that the XML is in fact well-formed and (if it
    >>> has a DTD) valid?
    >>>
    >>> sherm--
    >>>

    >> Yes it is , and is parsed OK under debugger.

    >
    > I wouldn't think Simple requires DTD or any thing else.
    > In fact I know thats not the case. I don't know the default
    > parser Simple uses, but Simple is not in itself a parser.
    >

    Right , no DTD and uses SAX

    > I never passed it a file name. Does it do that? Usually an open file
    > handle is passed in leu of an xml string. Pass some junk xml string and
    > see if it works. Some content at root level. Try to invoke an exception.
    >

    It works , since same program and xml file run OK on other systems or
    under perl debugger.
    > Try these two lines:
    >
    > use XML::Simple;
    > $XML::Simple::pREFERRED_PARSER = 'XML::parser';
    >

    Shall try it
    > I never use Simple anymore, I have my own complete package I have
    > written with many tools. Man that Expat though, its nightmare fast
    > but has got nothing else.
    >
    > sln


    Thanks.

    --
    TT
    Thumain Th., Nov 7, 2008
    #9
  10. Re: Envirnoment (?) question [LONG]

    On 2008-11-07, Thumain Th. <> wrote:
    > Le Fri, 07 Nov 2008 01:00:44 +0100, Eric Pozharski <>
    > a écrit:
    >
    >> On 2008-11-06, Thumain Th. <> wrote:
    >> *SKIP*
    >>

    > Thanks for your answer , s
    >
    >>> On one of our systems XMLin

    >>
    >> Please explain difference between 'one of' and 'our systems'.
    >>

    > Excellent question!
    > Same file and program runs OK on all our systems but not on THIS one.
    > THIS system is Suse 9.3 , perl 5.8.6 and old 5.000503 leaves
    > in/usr/local/lib/perl5/... , development
    > environment was migrated to this machine , perl 5.8.6 was installed and
    > many modules (including XML , ...)
    > were just copied from original /usr/local/lib/perl5/5.0000503 to same
    > directories (ie NOT 5.8.6) on this
    > system. They seem to function OK.


    Oh, no... I think, you are on your own with such a mess. I (strongly)
    advice to clean up and reinstall the whole environment the right way. I
    haven't personal experience with mixed environments, but that's surely
    doable. Post here for advice. Look, you can't "just copy", you must
    *install*. You are free to go your way, but consider changing it.

    > Other systems are RH 7.2/perl 5.000503 ,RH 6 and other linux flavors.
    >
    > One of our customers runs same system as THIS and program and file run OK
    > on it...
    >
    >>> crashes with 'illecal xml character' (file.xml is OK).

    >>
    >> Please copy-paste exact and full messages.
    >>
    >> *CUT*
    >>

    >
    >
    > XML::SAX::Exception::throw('XML::SAX::Exception::parse', 'Message',
    > 'Not a v
    > alid XML character: \'=\'') called at
    > /usr/lib/perl5/vendor_perl/5.8.6/XML/
    > SAX/PurePerl/Reader.pm line 92
    > XML::SAX::purePerl::Reader::match('XML::SAX::purePerl::Reader::Stream=ARRAY(
    > 0x890df10)', '=') called at
    > /usr/lib/perl5/vendor_perl/5.8.6/XML/SAX/PurePerl/XM
    > LDecl.pm line 52


    If my understanding of "Extensible Markup Language (XML) 1.0 (Fourth
    Edition)" (what I have on hand), section 4.1 is correct than

    '&#x' [0-9a-fA-F]+ ';'

    is perfectly valid B<CharRef>. C<=> fits that spec and is out of
    (even) discouraged ranges of Unicode. From POV of
    /usr/lib/perl5/vendor_perl/5.8.6/XML/SAX/PurePerl/Reader.pm it's not.
    Point. Either reconsider your way, or look at http://rt.cpan.org for
    bugreports of B<XML-SAX> distribution (that F<Reader.pm> is of it). If
    you'll find nothing promising, then read F<Changes> on
    L<http://cpan.org>; yes, not local (you don't know for sure of what
    version local F<Changes> are). If there won't be nothing too, then
    start fixing F<Reader.pm>.

    Look, if you'll go that long exciting way *and* accidentally succeed,
    then you'll feel yourself a kind of superman. Just keep in mind, fixing
    that particular problem doesn't solve the whole mess. You would just
    delay the next hit. And it's coming, I promise.

    *CUT*

    --
    Torvalds' goal for Linux is very simple: World Domination
    Eric Pozharski, Nov 7, 2008
    #10
  11. Thumain Th.

    Thumain Th. Guest

    Le Fri, 07 Nov 2008 08:33:28 +0100, <> a écrit:

    > On Fri, 07 Nov 2008 07:43:52 +0100, "Thumain Th."
    > <> wrote:
    >
    >> Le Thu, 06 Nov 2008 18:31:40 +0100, Sherm Pendley
    >> <> a
    >> écrit:
    >>
    >>> "Thumain Th." <> writes:
    >>>
    >>>> Hi,
    >>>>
    >>>> Sorry with this strange problem.
    >>>> We use XML::Simple to parse small xml files.
    >>>> Program was shortened to
    >>>>
    >>>> use strict;
    >>>> use XML::Simple;
    >>>> my $ref=XMLin('/var/tmp/file.xml')
    >>>>
    >>>> On one of our systems XMLin crashes with 'illecal xml character'
    >>>> (file.xml is OK).
    >>>
    >>> The error you're getting says that the file is not OK. Have you used a
    >>> different tool to verify that the XML is in fact well-formed and (if it
    >>> has a DTD) valid?
    >>>
    >>> sherm--
    >>>

    >> Yes it is , and is parsed OK under debugger.

    >
    > I wouldn't think Simple requires DTD or any thing else.
    > In fact I know thats not the case. I don't know the default
    > parser Simple uses, but Simple is not in itself a parser.
    >
    > I never passed it a file name. Does it do that? Usually an open file
    > handle is passed in leu of an xml string. Pass some junk xml string and
    > see if it works. Some content at root level. Try to invoke an exception.
    >
    > Try these two lines:
    >
    > use XML::Simple;
    > $XML::Simple::pREFERRED_PARSER = 'XML::parser';
    >
    > I never use Simple anymore, I have my own complete package I have
    > written with many tools. Man that Expat though, its nightmare fast
    > but has got nothing else.
    >
    > sln


    Thanks a lot, it worked , Still do not understand why OK with debugger not
    with program..

    --
    TT
    Thumain Th., Nov 13, 2008
    #11
  12. Thumain Th.

    Thumain Th. Guest

    Re: Envirnoment (?) question [LONG]

    Le Sat, 08 Nov 2008 00:00:09 +0100, Eric Pozharski <>
    a écrit:

    > On 2008-11-07, Thumain Th. <> wrote:
    >> Le Fri, 07 Nov 2008 01:00:44 +0100, Eric Pozharski
    >> <>

    [...]
    >> Excellent question!
    >> Same file and program runs OK on all our systems but not on THIS one.
    >> THIS system is Suse 9.3 , perl 5.8.6 and old 5.000503 leaves
    >> in/usr/local/lib/perl5/... , development
    >> environment was migrated to this machine , perl 5.8.6 was installed and
    >> many modules (including XML , ...)
    >> were just copied from original /usr/local/lib/perl5/5.0000503 to same
    >> directories (ie NOT 5.8.6) on this
    >> system. They seem to function OK.

    >
    > Oh, no... I think, you are on your own with such a mess. I (strongly)
    > advice to clean up and reinstall the whole environment the right way. I
    > haven't personal experience with mixed environments, but that's surely
    > doable. Post here for advice. Look, you can't "just copy", you must
    > *install*. You are free to go your way, but consider changing it.
    >

    [...]
    You are right of course , the reason is installing individual perl modules
    on each
    of our customers was supposed taking a long time , ....
    >
    > If my understanding of "Extensible Markup Language (XML) 1.0 (Fourth
    > Edition)" (what I have on hand), section 4.1 is correct than
    >

    [...]
    > Look, if you'll go that long exciting way *and* accidentally succeed,
    > then you'll feel yourself a kind of superman. Just keep in mind, fixing
    > that particular problem doesn't solve the whole mess. You would just
    > delay the next hit. And it's coming, I promise.
    >
    > *CUT*
    >

    Right again.
    Question was **just** why XML::Simple was OK under perl debugger , and not
    in progtam with
    same instructions.

    Thanks for your advice.

    --
    TT
    Thumain Th., Nov 13, 2008
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sean
    Replies:
    1
    Views:
    568
    Cowboy \(Gregory A. Beamer\)
    Oct 20, 2003
  2. =?Utf-8?B?UnlhbiBTbWl0aA==?=

    Quick Question - Newby Question

    =?Utf-8?B?UnlhbiBTbWl0aA==?=, Feb 14, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    626
    Iain Norman
    Feb 16, 2005
  3. =?Utf-8?B?YW5kcmV3MDA3?=

    question row filter (more of sql query question)

    =?Utf-8?B?YW5kcmV3MDA3?=, Oct 5, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    923
    Scott Allen
    Oct 6, 2005
  4. Philip Meyer
    Replies:
    0
    Views:
    400
    Philip Meyer
    Nov 30, 2003
  5. howa
    Replies:
    0
    Views:
    292
Loading...

Share This Page