App::FuguSeed::ListFile(3p) Perl Library Manual App::FuguSeed::ListFile(3p)

App::FuguSeed::ListFile - read a word list file and prove its digest

    use App::FuguSeed::ListFile;
    my $list = App::FuguSeed::ListFile->read($path);
    my @words  = @{ $list->{words} };
    my $digest = $list->{digest};

App::FuguSeed::ListFile is the one reader of a word list file. Both verbs of "fuguseed-words" take such a file, and each one reads it through this module.

The module computes the SHA-256 of the bytes of the file and refuses every digest but the one that App::FuguSeed::List pins. That digest proves the whole file, so the module makes no other check: the source list holds 2048 lines, and each line holds one word and one line feed.

Every method is a class method. The module keeps no state.

read($path) reads the word list file $path. The result is a hash reference with the 2048 words under "words", in list order, and the SHA-256 of the file as lower-case hex under "digest".

read() returns "undef" for a file that it cannot read, and for a file with another digest than the source list. It reports the reason through the default logger of "Fugu::Log".

A file that no directory holds, and a file that the process cannot open, are recoverable errors. A list with another digest is one too: the caller prints no sheet and gives the failure exit code.

App::FuguSeed::List, which pins the digest of the source list, and share/fuguseed/english.txt, the copy that ships with the distribution.

Dick Olsson <hi@senzilla.io>

2026-09-23 OpenBSD