[JDEV] XML::Stream bug under mod_perl

Abraham Ingersoll abe at dajoba.com
Tue Aug 7 20:15:44 CDT 2001


Hi,

We're using Net::Jabber under mod_perl/Mason to send messages based on
users web activity. When trying to use Net::Jabber in
this environment (underneath mod_perl), we came up with the following
error:

[error] package 'IO::Select' not registered for warnings at
/usr/lib/perl5/site_perl/5.6.0/XML/Stream.pm line 1276

A little investigation shows that this error occurs when XML::Stream
trys to call has_error against an IO::Select v1.14 object.
IO::Select::has_error has been depreciated in favor of
IO::Select::has_exception, at least in version >= 1.14 --

sub has_exception
{
 my $vec = shift;
 my $timeout = shift;
 my $e = $vec->[VEC_BITS];

 defined($e) && (select(undef,undef,$e,$timeout) > 0)
    ? handles($vec, $e)
    : ();
}

sub has_error
{
 warnings::warn("Call to depreciated method 'has_error', use
'has_exception'")
        if warnings::enabled();
 goto &has_exception;
}

Our workaround is to simply make XML::Stream call has_exception anywhere
it was calling has_error (3 lines). I imagine there's a way to
tell IO::Socket not to dump out that (fairly useless) warning, but I
couldn't figure it out. A smarter, backwards-compatible solution would be
to test which version of IO::Select XML::Stream's dealing with, and then
choose which (has_error/has_exception) method to use within XML::Stream
based on that. If this is the perferred fix, I'd be more than happy to
code this check into XML::Stream and submit patches if noone else
steps up.

Btw, many thanks to Mr. Eatmon for his work on Net::Jabber, along with
everyone else involved!

Abe




More information about the JDev mailing list