When generating a file with XML::Writer the script certainly builds the file
but when I go to test for it, it fails.  Does anyone have a reason why?  How
do I create a file that I can use in the rest of my script?

use XML::Writer;
use IO::File;
my $output = new IO::File(">test.xml");
my $writer = new XML::Writer(OUTPUT => $output);
$writer->startTag("greeting","class" => "simple");
$writer->characters("Hello, world!");
$writer->endTag("greeting");
$writer->end();
$output->close();

#Test to make sure this file exist before preceding
if (! -r $output) {
   print ("ERROR:  can't read /$output XML file.");
}

Reply via email to