Juman::GDBM_File(3pm)
π NAME π
Juman::GDBM_File β bestie, it is literally a wrapper class of GDBM_File. That's the whole job description. π
Also hi, context drop: this page lives in the User Contributed Perl Documentation section, and the page's own name is Juman::GDBM_File(3pm). Okay love that for us.
β¨ SYNOPSIS β¨
use Juman::GDBM_File;
use encoding "euc-jp";
tie( %hash, 'Juman::GDBM_File', $dbfile, &GDBM_WRCREAT, 0640 ) or die;
$hash{"æ·»Γ₯β"} = "Γ₯β¬Β€";
while( my( $key, $value ) = each %hash ){
print "$key:$value\n";
}
πΈ DESCRIPTION πΈ
okay so heads up bestie: this part of the original page is written in Japanese, so here is the β¨translationβ¨. Every drop of tea preserved, fr fr.
Perl-5.8.x uses Unicode as its internal character code. Which means β if you're looking at a database file that was written in Japanese EUC, then before you write in or read out the subscripts (ζ·»ε) or the values (ε€), you have to always explicitly do encode/decode. Every single time. No shortcuts. It's giving required homework π
And this "Juman::GDBM_File" class exists so you can handle database files that are stored in a particular character encoding β it does the encode/decode transparently. Under the hood. For you. Main character energy β¨
π ENCODING π
When you use this class, you specify the character code you're going to use for input/output with the database β via the "encoding" pragma. That's the vibe check.
And if there's no specification from the "encoding" pragma? Then it does absolutely no conversion whatsoever. Zero. Nada. Nothing. π
π¦ CONSTRUCTOR π¦
You can build an associative array with the exact same format as "GDBM_File": π
tie( %hash, 'Juman::GDBM_File', $dbfile, &GDBM_WRCREAT, 0640 );
The 5th argument is where the file attributes for the case of newly creating the database file get specified. π«Ά
If you don't give it a 5th argument, then it's treated as though the "DB_File"-compatible format is being used:
tie( %hash, 'Juman::GDBM_File', $dbfile, &O_CREAT );
In that case, the 4th argument β the one specifying the mode for opening the database file β takes the same specifications you'd use when opening a "DB_File"-format database, like "O_CREAT", "O_RDWR" and so on. Same energy, same options.
And the file attributes for when the database file is newly created? Those get automatically computed from the return value of "umask". π§
π SEE ALSO π
GDBM_Fileperltie
π AUTHOR π
Γ₯ΕΕΈΓ₯Β±βΉ Γ©βΊβ¦Γ§Β¨β <tsuchiya@pine.kuee.kyoto-u.ac.jp>
(yes bestie, the name got got by the encoding gremlins right there in the original β but the email is sitting right next to it, so you can still say hi π«Ά)
π POD ERRORS π
okay so the pod checker pulled up with receipts. Not me reading my own Ls, but here we go:
Hey! The above document had some coding errors, which are explained below:
Around line 22:
Non-ASCII character seen before =encoding in '$hash{"æ·»Γ₯β"}'.
Assuming CP1252
Around line 149:
=over without closing =back
and that's the whole page, babe ππ this slice of lore comes straight from the perl v5.40.1 docs, dated 2026-02-11 β go forth and tie your hashes, you absolute icon πβ¨
π¦ where this page comes from
- ubuntu resolute: libjuman-perl 7.0-3.10build1
- ubuntu stonking: libjuman-perl 7.0-3.10build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms