-w is kind of pan-galactic and influences modules you're calling, regardless
of their own 'warnings' settings.  Try 'use warnings' without -w.  See p861
in the camel 3rd edition.

HTH, GStC. 

-----Original Message-----
From: Mike Lesser [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 19, 2005 11:41 AM
To: Perl Beginners
Subject: XML Generator DBI

Hi all. I'm messing with XML & MySQL, and I may have run into a newbie snag.

I'm using XML::Generator ::DBI with XML::Handler::YAWriter, in the same
manner that I've seen in tutorials, the MySQL Cookbook, and other assorted
places.

> $writer = XML::Handler::YAWriter->new (AsString => 1); $query = 
> 'SELECT cd_airdate, cd_copies, cd_hilites FROM cds WHERE cd_labeled=0
>             ORDER BY cd_airdate';
> $generator = XML::Generator::DBI->new(  dbh =>$dbh,
>                                         Handler =>$writer,
>                                         RootElement=>"Creators",
>                                         Indent=>1,
>                                         QueryElement => ''); 
> $xml_output = $generator->execute($query);

According to the XML::Gen perldoc, "Nulls are handled by excluding either
the attribute or the tag." The XML looks and works just fine. No prob.

However,when I use the -w option with the shebang, I get a couple warnings
for each record of the database. They're all about the same:

"Use of uninitialized value in string eq at
/Library/Perl/5.8.1/XML/Generator/
DBI.pm line 180."

Now it seems to me that if nulls are supposed to be handled by the modules,
then why the warnings? Is it normal for modules to put out warnings during
their normal function? I'm used to C/C++ environments where you normally
eliminate any warning that appears.

Mike


--
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/>
<http://learn.perl.org/first-response>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to