Data::...ecoder(3pm)
π Data::TableReader::Decoder β the 3pm man page, bestie edition π
Okay so you found your way to Data::TableReader::Decoder(3pm), which lives in the User Contributed Perl Documentation corner of the perl universe. Pull up a chair, grab a strawberry π, and let's get into it.
β¨ NAME β¨
Data::TableReader::Decoder β it's the base class for table decoders π
πΈ VERSION πΈ
version 0.021 β yes, that's the one, no cap.
π¦ DESCRIPTION π¦
So here's the tea. This is an abstract base class, which is fancy-speak for "it describes the API, it does not do the actual work, that's on the subclasses, bestie." It's giving blueprint energy. π
A decoder's whole job β its one job, its main character moment β is to iterate table rows of a file that's holding tabular data. That's it. That's the assignment.
And here's the important part: if a file hands you multiple tables of data (think worksheets, or <TABLE> tags π), then the decoder should also support the next_dataset method. Multiple tables means multiple datasets means multiple moments, and the decoder has to be ready for all of them. π
π ATTRIBUTES π
filename
Set by TableReader. Useful for logging. That's literally it, and honestly? A queen. πβ¨
file_handle
Set by TableReader. This is what the iterator should parse. Like, the actual thing the iterator reads from. Don't sleep on it. π₯
π METHODS π
iterator
Okay so this one is a must β it must be implemented by the subclass, no skipping, no shortcuts, periodt. π
It returns an instance of Data::TableReader::Iterator.
Now here's the vibe: the iterator should return an arrayref every single time it gets called. And it should accept one optional argument β a slice that's needed from the record. π°
And why does that matter? Because all decoder iterators return arrayrefs, so that slice should be an arrayref of column indices, equivalent to this exact perl syntax right here:
@row[@$slice]
Copy it, love it, use it. π
π AUTHOR π
Michael Conrad <mike@nrdvana.net> β iconic behavior, honestly. π«Ά
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2024 by Michael Conrad.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Slay. π
And that's the whole page, bestie β no notes. This was Data::...ecoder(3pm) from perl v5.38.2, dated 2024-06-21. Mwah, take care of yourself, hydrate, and go iterate some rows. π§ππ
π¦ where this page comes from
- debian trixie: libdata-tablereader-perl 0.021-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdata-tablereader-perl 0.021-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdata-tablereader-perl 0.021-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms