locale(3)
π locale(3) β the PerlIO::locale situation π
okay bestie, so this is a page from the User Contributed Perl Documentation section of the manual (it's locale(3), yes, the lil number three means library/perl module territory π«Ά). sit down, grab a strawberry π, and let me tell you about a PerlIO layer that just gets your locale.
β¨ NAME β¨
PerlIO::locale β a PerlIO layer that uses the encoding of the current locale. literally what it says on the tin π
πΈ VERSION πΈ
0.07
π¦ SYNOPSIS π¦
use PerlIO::locale;
open my $filehandle, '<:locale', $filename or die $!;
that's it. that's the whole vibe. one use, one open, and your filehandle is speaking your locale's language π
π DESCRIPTION π
okay so here's the tea: this is mostly a per-filehandle version of the open pragma. you know, when you use it in this form:
use open ':locale';
that pragma does it globally, right? this module is like, "no babe, we can do that per-filehandle, just for you, just for this one file" β¨
so the encoding for the opened file will be set to the encoding corresponding to the locale currently in effect β if perl can guess it. and that "if" is doing a lot of heavy lifting, bestie. perl has to be able to figure out what your locale is asking for. no guessing, no encoding, no deal π
π AUTHOR π
Copyright (c) 2004, 2005, 2007, 2008, 2011, 2014 Rafael Garcia-Suarez <rgs@consttype.org>, and then rewritten by Leon Timmermans <leont@cpan.org>. two icons, one module, we love to see it π
π LICENSE π
This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. periodt π
π§ SOURCE π§
A git repository for the sources is at <https://github.com/rgs/PerlIO-locale>. go look, go star it, go read the source, it's giving open source main character energy π
π SEE ALSO π
openPerlIO::encodingI18N::Langinfo
iykyk β those three are the whole friend group. go say hi π«Ά
and that's the page, bestie!! this was locale(3) from perl v5.42.0, dated 2025-07-25 β thanks for reading, mwah πβ¨
π¦ where this page comes from
- fedora 43: perl-PerlIO-locale 0.10-39.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms