X
xhoster
The code in XML:arser::Style::Subs seems to be quite slow in some
situations, and also it silently eats any errors that might occur in
the call backs.
sub Start {
no strict 'refs';
my $expat = shift;
my $tag = shift;
my $sub = $expat->{Pkg} . "::$tag";
eval { &$sub($expat, $tag, @_) };
}
I've replaced it for my purposes with:
sub Start {
no strict 'refs';
my $sub = $_[0]->{Pkg} . "::$_[1]";
return unless defined &$sub;
&$sub(@_);
}
The sub End was also modified analogously.)
This is faster and propagates errors as expected. But it probably doesn't
work for AutoLoaded callbacks. I don't care about that for my current
purposes, but for the sake of general improvement, is there a way to
arrange for the code to be faster and propagate errors while still working
for AutoLoad?
Thanks,
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
situations, and also it silently eats any errors that might occur in
the call backs.
sub Start {
no strict 'refs';
my $expat = shift;
my $tag = shift;
my $sub = $expat->{Pkg} . "::$tag";
eval { &$sub($expat, $tag, @_) };
}
I've replaced it for my purposes with:
sub Start {
no strict 'refs';
my $sub = $_[0]->{Pkg} . "::$_[1]";
return unless defined &$sub;
&$sub(@_);
}
The sub End was also modified analogously.)
This is faster and propagates errors as expected. But it probably doesn't
work for AutoLoaded callbacks. I don't care about that for my current
purposes, but for the sake of general improvement, is there a way to
arrange for the code to be faster and propagate errors while still working
for AutoLoad?
Thanks,
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.