Are locales global in perl?

I am debugging a perl script that looks like this (simplified):

#!/usr/bin/perl    
use strict;
use warnings;

use Evil::Module;

printf "%.3f\n", 0.1;

This script outputs 0,100(note ,instead .). If I comment on the instruction use Evil::Module, the output will be 0.100.

I believe that this is due to the installation of the language in the module. But locale is a lexical pragma (according to the man page), and it is not used in the script. What's going on here?

+3
source share
1 answer

The pragma is use localelexical, but if the Evil :: Module uses POSIX::setlocale, then the locale change is global.

See more details perldoc perllocale.

+5

Source: https://habr.com/ru/post/1753904/


All Articles