in reply to Browser choking on XML-header

Add some error checking to   my $outfile = new IO::File(">test.xml"); If it fails, you'll be passing   OUTPUT => undef to the XML::Writer constructor. It looks like XML::Writer defaults to STDOUT in this case.

This would cause your script to emit XML before it's emitted a header, which would cause the error you're seeing.

Props to VSarkiss for prodding me to take a second look.

Replies are listed 'Best First'.
Re: Re: Browser choking on XML-header
by schumi (Hermit) on Dec 11, 2002 at 20:04 UTC
    Aargh!

    The moment I read your second reply, I realised that this could in fact be a problem with permissions, with me running the script from the command line as a different user than the browser would - and the browser might not have write-permission to that directory...

    Quick ssh into the server at work, and lo! it works.

    ++dws for turning my head into the right direction!

    --cs

    There are nights when the wolves are silent and only the moon howls. - George Carlin