I
Ian Gregory
Hi,
One of our servers has recently been upgraded and as a result both
libxml and XML::LibXML have been upgraded. The OS is OpenBSD 3.3.
libxml has gone from version 2.4.18 to 2.5.7p1 and XML::LibXML from
1.40 to 1.54
However, since the upgrade, XML::LibXML seems to be affecting Perl's
file handling in ways it shouldn't. The following example illustrates
this:
-----------------
$cat test.pl
#!/usr/bin/perl -w
use strict;
use XML::LibXML;
my $xml_parser=XML::LibXML->new();
#This breaks things in an interesting way
my $style_doc=$xml_parser->parse_file('test.xml');
print "1\n";
open(FOO,">foo.txt") or die ("Can't open");
print "2\n";
print FOO "test\n" or die ("Can't print");
print "3\n";
close FOO or die ("Can't close: $!");
print "4\n";
$cat test.xsl
<?xml version="1.0"?>
<foo>
<bar />
</foo>
$./test.pl
1
2
3
Can't close: Bad file descriptor at ./test.pl line 18.
-----------------
The file foo.txt is created but is empty. Commenting out the
"$xml_parser->parse_file" line leads to the script giving the expected
output (foo.txt contains "test" and 1234 is printed)
I've looked through the relevant changelogs but I can't see anything
which would lead to this problem. Has anyone else experienced this
kind of problem?
Thanks in advance!
One of our servers has recently been upgraded and as a result both
libxml and XML::LibXML have been upgraded. The OS is OpenBSD 3.3.
libxml has gone from version 2.4.18 to 2.5.7p1 and XML::LibXML from
1.40 to 1.54
However, since the upgrade, XML::LibXML seems to be affecting Perl's
file handling in ways it shouldn't. The following example illustrates
this:
-----------------
$cat test.pl
#!/usr/bin/perl -w
use strict;
use XML::LibXML;
my $xml_parser=XML::LibXML->new();
#This breaks things in an interesting way
my $style_doc=$xml_parser->parse_file('test.xml');
print "1\n";
open(FOO,">foo.txt") or die ("Can't open");
print "2\n";
print FOO "test\n" or die ("Can't print");
print "3\n";
close FOO or die ("Can't close: $!");
print "4\n";
$cat test.xsl
<?xml version="1.0"?>
<foo>
<bar />
</foo>
$./test.pl
1
2
3
Can't close: Bad file descriptor at ./test.pl line 18.
-----------------
The file foo.txt is created but is empty. Commenting out the
"$xml_parser->parse_file" line leads to the script giving the expected
output (foo.txt contains "test" and 1234 is printed)
I've looked through the relevant changelogs but I can't see anything
which would lead to this problem. Has anyone else experienced this
kind of problem?
Thanks in advance!