1Config::INI::Reader::MuUlsteirliCnoen(t3r)ibuted Perl DoCcounmfeingt:a:tIiNoIn::Reader::Multiline(3)
2
3
4
6 Config::INI::Reader::Multiline - Parser for .ini files with line
7 continuations
8
10 If act.ini contains:
11
12 [general]
13 conferences = ye2003 fpw2004 \
14 apw2005 fpw2005 hpw2005 ipw2005 npw2005 ye2005 \
15 apw2006 fpw2006 ipw2006 npw2006
16 cookie_name = act
17 searchlimit = 20
18
19 And your program does:
20
21 my $config = Config::INI::Reader::Multiline->read_file('act.ini');
22
23 Then $config contains:
24
25 {
26 general => {
27 cookie_name => 'act',
28 conferences => 'ye2003 fpw2004 apw2005 fpw2005 hpw2005 ipw2005 npw2005 ye2005 apw2006 fpw2006 ipw2006 npw2006',
29 searchlimit => '20'
30 }
31 }
32
34 Config::INI::Reader::Multiline is a subclass of Config::INI::Reader
35 that offers support for line continuations, i.e. adding a "\<newline>"
36 (backslash-newline) at the end of a line to indicate the newline should
37 be removed from the input stream and ignored.
38
39 In this implementation, the backslash can be followed and preceded by
40 whitespace, which will be ignored too (just as whitespace is trimmed by
41 Config::INI::Reader).
42
44 All methods from Config::INI::Reader are available, and none extra.
45
47 The following two methods from Config::INI::Reader are overriden (but
48 still call for the parent version):
49
50 parse_value_assignment
51 This method skips lines ending with a "\" and leaves them to
52 "handle_unparsed_line" for buffering. When given a "normal" line to
53 process, it prepends the buffered lines, and lets the ancestor method
54 deal with the resulting line.
55
56 Note that whitespace at the end of continued lines and at the beginning
57 of continuation lines is trimmed, and that consecutive lines are joined
58 with a single space character.
59
60 handle_unparsed_line
61 This method buffers the unparsed lines that contain a "\" at the end,
62 and calls its parent class version to deal with the others.
63
65 Thanks to Vincent Pit for help (on IRC, of course!) in finding a
66 descriptive but not too long name for this module.
67
69 Philippe Bruhat (BooK), <book@cpan.org>, who needed to read act.ini
70 files without AppConfig.
71
73 Copyright 2014-2015 Philippe Bruhat (BooK), all rights reserved.
74
76 This program is free software; you can redistribute it and/or modify it
77 under the same terms as Perl itself.
78
79
80
81perl v5.30.1 2020-01-29 Config::INI::Reader::Multiline(3)