Damit braucht die FastCGI-basierte Variante locale/de/all nicht bei
jedem Aufruf neu einzulesen.
use strict;
+my %locales_by_country;
+
sub new {
$main::lxdebug->enter_sub();
$country =~ s|.*/||;
$country =~ s|\.||g;
- my $self = {};
- bless $self, $type;
+ if (!$locales_by_country{$country}) {
+ my $self = {};
+ bless $self, $type;
+
+ $self->_init($country);
- $self->_init($country);
+ $locales_by_country{$country} = $self;
+ }
$main::lxdebug->leave_sub();
- return $self;
+ return $locales_by_country{$country}
}
sub _init {