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. FYI, I did load the module at the beginning of the script (use XML::Writer;) and it is installed. 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 Databa +se 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);

In reply to Error when creating a new instance of XML::Writer by ev0lution

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.