
ev0lution37
Novice
Nov 8, 2012, 11:28 AM
Post #1 of 7
(5471 views)
|
Error when creating a new instance of XML::Writer
|
Can't Post
|
|
I'm trying to implement XML::Writer to help dump a MySQL database to XML format, however I'm getting the following error:
Can't locate object method "new" via package "XML::Writer" at /apollo/volume/software/application/artemis/bin/KapowStarter.pl line 371. I'm implementing the code as a subroutine, but when I initially had it running locally as it's own script it was functioning just file. Here's the spot of code that is giving me the problems. It seems that it is trying to find the 'new()' function within the XML::Writer module, but can't find it. No clue why not. Thanks in advance for the help!
sub SQLtoXML { $log->debug("Attempting to pull from MySQL DB and write to XML.." . "\n"); #Parameter being passed is the Source ID to check against the Database and final directory for XML file. my $PassedSource = $_[0]; my $FinalDir = $_[1]; my $FileName = ""; #Set up temporary XML output file for XML::Writer my $output = IO::File->new(">output.xml"); #Initiate XML::Writer my $writer = XML::Writer->new(OUTPUT => $output);
|