[Forwarded from "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>]

Hello,

In response to :

Kurt George Gjerde wrote:
> BTW: I've fixed my "can't coerce GLOB to string" problem I had last
week.
> Was unrelated to mod_perl (sorry). It seems XML::LibXSLT produced some
> errors which went straight to STDERR. Under CGI these ends up in the
> error_log but under mod_perl it seems STDERR is just a black hole (?).
> Would it be possible to map STDERR to log_error()?

Unless I'm missing something, mod_perl doesn't do anything special with
STDERR
(it does tie STDIN and STDOUT for 'perl-script' handlers). Apache opens
stderr
to error_log, and then everything just works. e.g. if you do:

warn "Foo";
or
print STDERR "OOOPS\n";

this ends up in error_log, no?

I suppose that XML::LibXSLT redefines STDERR then. Try to see what it
does to
create this problem.



The key to this problem is that the function $parser->parse_string()
cannot take a scalar as argument.

This way it works and doesn't produce "Can't coerce ..." anymore :

my $sheet = $parser->parse_string(<<'EOT');
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
<xsl:output method="text" indent="no"/>
<xsl:strip-space elements="FILTER_RULE NAT_RULE LOG_RULE"/>
<!-- this XSLT sheet transforms a netfilter XML rule document into an
iptables script -->

<xsl:template match="NETFILTER">

...

EOT

Best regards

Jean Philippe GUILLEMIN
http://shweps.free.fr
[EMAIL PROTECTED]




Reply via email to