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

user1318538 picture user1318538 · Sep 21, 2012 · Viewed 27k times · Source

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

Answer

Jean picture Jean · Sep 21, 2012

This command will give you a list of locales:

locale -a

From a Perl script you can execute the same using

system("locale -a");