Locale::Scope - scope based setlocale(3)
use POSIX qw/LC_TIME/; use Locale::Scope qw/locale_scope/; # hear LC_TIME locale is C!! { my $scope = locale_scope(LC_TIME, "ja_JP.UTF-8"); # hear LC_TIME locale is ja_JP.UTF-8!! { my $scope = locale_scope(LC_TIME, "es_AR.ISO8859-1"); # hear LC_TIME locale is es_AR.ISO8859-1!! } # hear LC_TIME locale is ja_JP.UTF-8!! } # hear LC_TIME locale is C!!
THE SOFTWARE IS IT'S IN ALPHA QUALITY. IT MAY CHANGE THE API WITHOUT NOTICE.
Locale::Scope is scope based setlocale(3) for rollback locale at the end of a scope.
Set the program's current locale. It creates a new Locale::Scope object which rollbacks locale when its DESTROY method is called.
my $scope = locale_scope($category, $locale); # or my $scope = Locale::Scope->new($category, $locale);
POSIX Scope::Guard
Copyright (C) karupanerura.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
karupanerura <karupa@cpan.org>
To install Locale::Scope, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Locale::Scope
CPAN shell
perl -MCPAN -e shell install Locale::Scope
For more information on module installation, please visit the detailed CPAN module installation guide.