Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a way to find list of valid locales in my linux using perl?

Tags:

linux

perl

locale

I need to find a list of locale installed/supported in my linux machine. is there a way to find a list of valid locales in my linux using perl ?

thanks

like image 701
user1318538 Avatar asked Sep 20 '12 22:09

user1318538


People also ask

How do I know if I have installed locales?

To view information about the current installed locale, use the locale or localectl utility. You can view more information about an environmental variable, for example LC_TIME, which stores the time and date format.

What is my locale Linux?

Locale is basically a set of environmental variables that defines the user's language, region, and any special variant preferences that the user wants to see in their Linux interface.

How do I change locale in Linux?

To change the value of a locale which is already set, we can edit the . bashrc profile of the use who needs the new locale. $ locale LANG=en_IN. utf8 LANGUAGE=en_US LC_CTYPE="en_IN.


1 Answers

This command will give you a list of locales:

locale -a 

From a Perl script you can execute the same using

system("locale -a"); 
like image 143
Jean Avatar answered Sep 21 '22 06:09

Jean