-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathTODO.txt
53 lines (37 loc) · 2.41 KB
/
TODO.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# t/45_eol.t
strict_eol i.c.w. $csv->eol (undef);
Fix inconsistence between 1:0:1: and 1:0:1:"
Fix inconsistence between 1:1:1: and 1:1:1:"
# https://www.perlmonks.org/index.pl?node_id=11163264
It's the inconsistency of csv (in => ..., out => ...);
| in
+---------------------------------------------------------------
| Data Structure | Sub | File Name | File Handle
----+------------------+----------------+-------+----------------------+---------------
out | [Absent] | Works | Works | Works | Works
| Undefined Scalar | Works | Works | Run-time error | Run-time error
| File Name | Works | Works | Instructs programmer | Run-time error
| File Handle | Works | Works | Run-time error | Run-time error
----+------------------+----------------+-------+----------------------+---------------
The instruction to the programmer is doubly weird because it could simply do what it would do if the programmer used the suggested code.
Current plan:
Support for (in, out) : (file, file), (fh, fh), (file, fh), and (fh, file) with
callback on the level of after_parse where after_parse then calls the inner CSV
with the eol_type of the first line of in and then sets the record to \"skip".
The CSV object is reused for in *and* out, so all settings are shared, including
the errors.
Document that when in this mode, on_in cannot be used.
Advantages of the previous documented use of csv with an explicit csv call for
out, is that the in-stream is completely parsed before the output is generated,
so it won't output if the input is invalid (at row 12345).
Trace why out => sub { ... } was not implemented and if this could be used for
above plan. (likely because of the same reason why (in => "file", out => "file")
was abandoned several times). Note that *all* attributes are shared. Now that we
have strict_eol, and internal stored eol_type, the need for "eol" for output has
gone. (we can alo use ->say, but reuse of eol_type is easier).
We also need a read-only $csv->eol_type to check what was detected.
# https://www.perlmonks.org/index.pl?node_id=11163263
The function csv () is streaming!
You can encode as a stream.
You can decode as a stream.
But you can't transform as a stream. The inner call (csv (in => "a.csv, ...)) loads the entire file into memory.