[Date Prev][Date Next][Thread Prev][Thread Next]
[Search]
[Date Index]
[Thread Index]
Re: [FWP] Fun with Die
On Thu, Mar 22, 2001 at 03:30:13PM +0100, Julien Quint wrote:
> 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:
FYI Have you had a look at Locale::gettext and Locale::Maketext?
Smells like you're creating a modern gettext, something that uses a
sane format. Maketext is pretty sophisticated and may be overkill.
> 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.
$SIG{__WARN__} = sub { warn localize @_; };
$SIG{__DIE__} = sub { die localize @_; };
--
Michael G. Schwern <schwern@pobox.com> http://www.pobox.com/~schwern/
Perl6 Quality Assurance <perl-qa@perl.org> Kwalitee Is Job One
I'm successful because I'm lucky. The harder I work, the luckier I get.
==== Want to unsubscribe from Fun With Perl? Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
==== unsubscribe