Accounting —
Interchange 5.9.0:
Source: lib/Vend/Config.pm
Line 3071 (context shows lines 3071-3135)
sub parse_locale { my($item,$settings) = @_; return ($settings || '') unless $settings =~ /[^\d.]/; $settings = '' if "\L$settings" eq 'default'; my $name; my ($c, $store); if(defined $C) { $c = $C->{$item} || { }; $C->{$item . "_repository"} = {} unless $C->{$item . "_repository"}; $store = $C->{$item . "_repository"}; } else { no strict 'refs'; $c = ${"Global::$item"} || {}; ${"Global::$item" . "_repository"} = {} unless ${"Global::$item" . "_repository"}; $store = ${"Global::$item" . "_repository"}; } my ($eval, $safe); if ($settings =~ s/^\s*([-\w.@]+)(?:\s+)?//) { $name = $1; undef $eval; $settings =~ /^\s*{/ and $settings =~ /}\s*$/ and $eval = 1; $eval and ! $safe and $safe = new Vend::Safe; if(! defined $store->{$name} and $item eq 'Locale') { my $past = POSIX::setlocale(POSIX::LC_ALL); if(POSIX::setlocale(POSIX::LC_ALL, $name) ) { $store->{$name} = POSIX::localeconv(); } POSIX::setlocale(POSIX::LC_ALL, $past); } my($sethash); if ($eval) { $sethash = $safe->reval($settings) or config_warn("bad Locale setting in %s: %s", $name, $@), $sethash = {}; } else { $settings =~ s/^\s+//; $settings =~ s/\s+$//; $sethash = {}; %{$sethash} = Text::ParseWords::shellwords($settings); } $c = $store->{$name} || {}; my $nodefaults = delete $sethash->{MV_LOCALE_NO_DEFAULTS}; for (keys %{$sethash}) { $c->{$_} = $sethash->{$_}; } } else { config_error("Bad locale setting $settings.\n"); } $C->{LastLocale} = $name if $C and $item eq 'Locale'; $store->{$name} = $c unless $store->{$name}; return $c; }