This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
loc_tools.pl: Cache results
authorKarl Williamson <khw@cpan.org>
Mon, 3 Jul 2023 20:37:59 +0000 (14:37 -0600)
committerKarl Williamson <khw@cpan.org>
Wed, 12 Jul 2023 12:32:10 +0000 (06:32 -0600)
commite8cff0e82d6684452cd8572a0e748f6cc0847a13
tree86f633c66bea237a909222d1a055e491980de7a5
parent8b5e02e7a3a560886f72ae5466915597b4434493
loc_tools.pl: Cache results

Some of the functions in this file are slow, because it speculatively
tries various potential somewhat commonly-encountered locales to see
which ones actually work on this platform.

On many boxes, much of the potential list can be quickly gathered from a
call to a system command, but on other platforms, including Windows, the
list comes from trying all the possibilities in the <DATA> section of
the file, including permutations.

And the determination that each locale actually works takes time.

So this commit caches the list of available locales it finds, avoiding
doing all this work again if the calling test program calls it again.
t/loc_tools.pl