1Text::RecordParser::ObjUescetr(3C)ontributed Perl DocumeTnetxatt:i:oRnecordParser::Object(3)
2
3
4
6 Text::RecordParser::Object - read delimited text files as objects
7
9 my $o = $p->fetchrow_object;
10 my $name = $o->name;
11
13 new
14 Just call "fetchrow_object" on a Text::RecordParser object to
15 instantiate an object.
16
18 This module extends the idea of how you interact with delimited text
19 files, allowing you to enforce field names and identify field aliases
20 easily. That is, if you are using the "fetchrow_hashref" method to
21 read each line, you may misspell the hash key and introduce a bug in
22 your code. With this module, Perl will throw an error if you attempt
23 to read a field not defined in the file's headers. Additionally, any
24 defined field aliases will be created as additional accessor methods.
25
26 As much as I like the full encapsulation of inside-out objects (e.g.,
27 as described in _Perl Best Practies_ by Damian Conway and provided by
28 Class::Std), I couldn't figure out a way to dynamically create the
29 class at runtime. Besides, I figure this interface is only for those
30 who want to use the overhead of objects to enforce policy. If you use
31 this module and still access the hash underneath the object, I can't
32 really help you.
33
35 Class::Accessor.
36
38 Ken Youens-Clark <kclark@cpan.org>
39
41 Copyright (C) 2009-10 Ken Youens-Clark. All rights reserved.
42
43 This program is free software; you can redistribute it and/or modify it
44 under the terms of the GNU General Public License as published by the
45 Free Software Foundation; version 2.
46
47 This program is distributed in the hope that it will be useful, but
48 WITHOUT ANY WARRANTY; without even the implied warranty of
49 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
50 General Public License for more details.
51
52
53
54perl v5.32.1 2021-01-27 Text::RecordParser::Object(3)