sfinster has asked for the wisdom of the Perl Monks concerning the following question:

I'm using perl 5.8.0 on solaris and linux systems. I'd like to be able to determine the user's default language. On Windows I would use GetLocaleInfo with LOCALE_SLANGUAGE. Is there a perl equivalent?

Replies are listed 'Best First'.
Re: GetLocaleInfo equivalent?
by wazoox (Prior) on Mar 16, 2006 at 16:19 UTC
    Basically add this line at the beginning of your scripts:
    use POSIX qw(locale_h);
    And get the current locale with
    my $locale = setlocale(LC_CTYPE);
    Try "perldoc perllocale" in a shell for all the gory details or search for 'locale' on http://perldoc.perl.org.
Re: GetLocaleInfo equivalent?
by zer (Deacon) on Mar 16, 2006 at 16:19 UTC
    #!/usr/bin/perl foreach (keys %ENV){ print "$_ = $ENV{$_}\n" if (/LANG/); }

    This says what language set is being used