2004-10-25

The Peculiar Ways of Sourceforge and Perl

I finally got the RSS feeds for my SourceForge group, SandTrap, integrated into the SandTrap website which is hosted on SourceForge. I used the Simple RSS Agreggator perl script. Since SourceForge doesn't have the XML::Simple module installed I had to rely on the usage of my own copy of XML::Simple. I couldn't get the script working through HTTP access but it worked fine through ssh access. I knew it had something to do with XML::Simple. I recently solved the problem by removing the following lines from the build_tree_xml_parser() subroutine in XML::Simple:
if($filename) {
# $tree = $xp->parsefile($filename); # Changed due to prob w/mod_perl
local(*XML_FILE);
open(XML_FILE, '<', $filename) || croak qq($filename - $!);
$tree = $xp->parse(*XML_FILE);
close(XML_FILE);
}
else {
$tree = $xp->parse($string);
}

I do not know why this worked or why the problem occurred in the first place but if any one else runs into a similar problem I hope this helps solve it. Note: the error message that made me realize the problem said something about too many arguments when calling open(), referring to $filename I assume. Maybe I should report this as a bug in XML::Simple.

0 Comments:

Post a Comment

<< Home


Creative Commons License
This work is licensed under a Creative Commons License.