When Chooser.pm fails to load a plugin all it prints is:
Module loading error:
That is, it does not print the reason why it failed to load the plugin.
The reason for this is that '$@' gets clobbered at some time between the
error and when if finally gets printed. Storing it in an intermediate
variable solves the issue.
Changelog:
* lib/Locale/Po4a/Chooser.pm
Francois Gouget <fgouget(a)codeweavers.com>
Store '$@' in an intermediate variable so it does not get clobbered
before we report the plugin-load error.
--
Francois Gouget
fgouget(a)codeweavers.com
Index: lib/Locale/Po4a/Chooser.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Chooser.pm,v
retrieving revision 1.25
diff -u -p -r1.25 Chooser.pm
--- lib/Locale/Po4a/Chooser.pm 27 Feb 2005 23:32:02 -0000 1.25
+++ lib/Locale/Po4a/Chooser.pm 24 May 2005 17:45:50 -0000
@@ -41,9 +41,10 @@ sub new {
if (! UNIVERSAL::can("Locale::Po4a::$modname", 'new')) {
eval qq{use Locale::Po4a::$modname};
if ($@) {
+ my $error=$@;
warn wrap_msg(gettext("Unknown format type: %s."), $module);
warn wrap_mod("po4a::chooser",
- gettext("Module loading error: %s"), $@)
+ gettext("Module loading error: %s"), $error)
if defined $options{'verbose'} && $options{'verbose'} >
0;
list(1);
}