[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[FWP] Fun with Die



Hi all,

I am writing a small localization module that can "localize" a filehandle, by 
tying a filehandle to a Localizer class that has a "phrasebook" to translate 
chunks of text. It is used like this:

         my $l = new Localizer("messages.xml");
         $l->localize_fh(STDOUT => "fr");
         print "Simple message\n";
         # prints "Ceci est un message simple.\n"

where messages.xml is an XML file describing the possible messages as found 
in the code, and as they should be output in the given locales. This is 
working fine and is actually fun to write, but then I came into the following 
problem: how to localize messages sent by "die" and "warn"? Even though they 
write to STDERR, they do not seem to use the PRINT method, so their messages 
are not caught. I'm wondering how that can be done.

Julien

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe