ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-xml
perl-xml
POSSIBLE BUG in XML::Simple
by Nikola Janceski other posts by this author
Sep 3 2002 8:04PM messages near this date
view in the new Beta List Site
Re: XML::LibXML::Element->find() | Still can't make XML::Parser
Hey folks,
	I think I finally resolved my issue with my "strange error" posts
from a few weeks ago. It has rotted my brains trying to breakdown the code
to it's simpliest form where the action still occurs. And I have
replicatable code now. I have CCed the author/copyrighter.

I need someone to confirm if it's a bug on different OS platforms and
versions of rsh. You might want to look at this when you have a few minutes
to spare.

The Error:
----------
Can't locate object method "new" via package "XML::SAX::PurePerl" (perhaps
you forgot to load "XML::SAX::PurePerl"?) at
/somepath/perl-5.6.1-unix/lib/perl5/site_perl/5.6.1/XML/SAX/ParserFactory.pm
line 37.

[but I have expat installed correctly]

Here are my specs:
------------------
SunOS host1 5.6 Generic_105181-29 sun4u sparc SUNW,Ultra-80
rsh is from OS distribution and according to the man pages is (14 July
1994).
Perl 5.6.1 with XML::Simple1.08_01, XML-Parser-2.31, expat-1.95.4 and other
modules not related to this.

The code:
---------
# your perl here
use XML::Simple;

my $XML_FILE = "/u/njancesk/test.xml";
die "Can't read $XML_FILE\n" if !-r "$XML_FILE"; #check permissions

while ($n++ < 55 ){ ## error on 55 or greater when rsh
`IAmNotACommand`; # some command that doesn't exist (originally was a typo)
# yeah I know I should be checking $! and $? (the work around)
}

my $SHOW = XMLin("$XML_FILE", forcearray =>  1 );
__END__


$XML_FILE contains:
-------------------
<opt> 
  <AAAA date="8/12/2002" show="1" name="V3.1.5" /> 
  <BBBB date="8/12/2002" show="1" name="V3.1.5" /> 
  <CCCC date="8/12/2002" show="1" name="V3.1.9" /> 
</opt> 


Steps to replicate:
-------------------
1. run a command line rsh to the host you are on with the script path as the
command.
ie. /bin/rsh host1 /u/njancesk/pl.pl
2. see the error, if you didn't see the error try making the 55 in the while
loop a bigger number.


Strange thing is this ONLY happens when you run the script via an rsh
command line. if the number is less than 55 the error doesn't occur. if it's
run on the command line without rsh on the same host, no error occurs.

I don't know if it's a bug with the module, core perl, or rsh, but this is
by far the wackiest possible bug I have run into. I depleted 20 hours trying
to fix this error in my script, which I found a work around.

Thank you for your help and contributions!

Nikola Janceski

Thinking is easy, it's implementing ideas and putting thoughts to paper that
is difficult.
-- Nicky J. from da' Bronx


----------------------------------------------------------------------------
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.

_______________________________________________
Perl-XML mailing list
Perl-XML@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved